Recent

Author Topic: LazSDL2 package for Android development  (Read 17101 times)

Imants

  • Full Member
  • ***
  • Posts: 181
LazSDL2 package for Android development
« on: June 16, 2016, 02:52:44 pm »
I have advanced my LazSDL2Design package little bit. Now I am trying to create easy android development inside Lazarus. My main goal is to developer press build button in Lazarus and he gets ".apk" file and do not manipulate any java code or any other android specifics file.

I have written about how I set up my cross compilation enviorment in Ubuntu 64 bit here: https://xp-dev.com/wiki/232197/Installing%20Lazarus%20multi-platform%20environment%20on%20Ubuntu%2064-bit

And I have written little bit about how to configure Lazarus for android development here: https://xp-dev.com/wiki/232197/LazSDL2Design%20package%20configuration

And I have written how to start develop cross compiling Lazarus project using my LazSDL2Design package here: https://xp-dev.com/wiki/232197/LazSDL2Design%20package

Downloads:
sdl2-1.3.1.tgz - https://files.inbox.lv/ticket/e9749e0a48a95c98928ea236da031863118fcf53/sdl2-1.3.1.tgz

1.3.1.zip - https://files.inbox.lv/ticket/0d5490035b77ee65cea030b858aa1cc8ad274376/sdl2-1.3.1.zip

mewpokemon

  • New Member
  • *
  • Posts: 29
Re: LazSDL2 package for Android development
« Reply #1 on: June 25, 2016, 11:52:39 pm »
Thank you for working on this. 

However, I tried to set-up a working environment and it seems I failed.  I couldn't compile the sdl_android example successfully.

There were no instructions about the binutils so as the compiler failed, unable to find them, I created symbolic links to the ones in the Android NDK (ar, as, ld) in /usr/bin.

The compile now fails at the link stage complaining that there is an invalid STRING in the link.res file which seems to be temporary since I can't open it (Lazarus can't find it).

On investigation, I'm concerned about a $Android(libraries) reference in the configuration.  I'm not sure what this would or should resolve to or how it is configured.  I am uncertain what the error is caused by though.

Further help would be very much appreciated.

Thanks again.

Imants

  • Full Member
  • ***
  • Posts: 181
Re: LazSDL2 package for Android development
« Reply #2 on: June 27, 2016, 07:28:20 am »
Thanks for trying to use my project I am in very dire need in additional testing :)

I created symbolic links in $HOME/bin for

arm-linux-androideabi-as -> /<path>/android-ndk-linux_11/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-as
arm-linux-androideabi-ld -> /<path>/android-ndk-linux_11/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld
arm-linux-androideabi-ld.bfd -> /<path>/android-ndk-linux_11/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld.bfd
arm-linux-androideabi-ld.gold -> /<path>/android-ndk-linux_11/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld.gold

I think /usr/bin will work too.

Have you set path to android SDK and NDK in Lazarus->Tools->Options...->SDL2->General ?

I could not set these paths automatically because fpc compiler used them internally and I for now do not know where to set them so that fpc see them
« Last Edit: June 27, 2016, 07:41:15 am by Imants »

mewpokemon

  • New Member
  • *
  • Posts: 29
Re: LazSDL2 package for Android development
« Reply #3 on: June 29, 2016, 01:30:33 am »
Whoops..  Sorry, I made the links in /usr/local/bin.  I had set the paths in Tools|Options.

Adding the links for *ld.bfd and *ld.gold made the difference.  These weren't in the official instructions I was trying to adapt.  The project now compiles.  I get libexample.so in the dist/arm-android directory.

Would you be able to provide further assistance?  I'm very new to Android development, especially from the linux command-line.  I have really only used Delphi and Flash Builder for it.  How do I package the libs etc into an apk for installation?

Thanks for your help.

Imants

  • Full Member
  • ***
  • Posts: 181
Re: LazSDL2 package for Android development
« Reply #4 on: June 29, 2016, 07:11:01 am »
Yes I know that this is not in official documentation because I totally forgot about this before you reminded me :). I will write it somewhere  :-[

If you have set build mode Android in example project  (witch is default) and set "ant" path in SDL->General options Lazarus should generate ".apk" file automatically. Whole purpose of my package is to create ".apk" file without android knowledge :). There was bug in my project that it would do nothing if ant is not specified and no error messages will be given :(

Now I am making so that you can automatically sign your ".apk" file too.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2515
    • havefunsoft.com
Re: LazSDL2 package for Android development
« Reply #5 on: June 29, 2016, 07:37:15 am »
Whole purpose of my package is to create ".apk" file without android knowledge :)
What about other Android oriented packages, aren't they generating .apk files themselves?
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

mewpokemon

  • New Member
  • *
  • Posts: 29
Re: LazSDL2 package for Android development
« Reply #6 on: June 29, 2016, 09:03:49 am »
I configured ant to be /usr/bin/ant.  I think it was already installed but I made sure by installing the ant packages.

I don't think its working.  The last message in the output is about copying the libexample.so to libmain.so.  There is no build.xml if there is supposed to be, either.

Could I be doing something wrong?  Do I have the wrong ant?

Imants

  • Full Member
  • ***
  • Posts: 181
Re: LazSDL2 package for Android development
« Reply #7 on: June 29, 2016, 01:26:12 pm »
No at that point ant should not be used.

I library coping was successful
You should get message "Copying resources"
If you do not get this message something went wrong with copiing .so files.
Can you post me Lazarus compiler message log content?

Imants

  • Full Member
  • ***
  • Posts: 181
Re: LazSDL2 package for Android development
« Reply #8 on: June 29, 2016, 02:46:47 pm »
Whole purpose of my package is to create ".apk" file without android knowledge :)
What about other Android oriented packages, aren't they generating .apk files themselves?

I do not know any android oriented package in lazarus there was some project where was predefined some android stuf but that is it. I am here more striving to get Delphi like experience where you press build in Lazarus and you get working "apk" file

Imants

  • Full Member
  • ***
  • Posts: 181
Re: LazSDL2 package for Android development
« Reply #9 on: June 29, 2016, 02:59:38 pm »
This is how looks Lazarus message for successful compilation. Ant starts to work only at "Progress: Building android" step

Code: [Select]
Compile Project, Mode: Android, OS: android, CPU: arm, Target: dist/arm-android/libexample.so: Success
Messages, Warnings: 2
Verbose: Creating project directory Structure
Verbose: Directory created: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/libs/armeabi
Verbose: Directory created: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/src
Verbose: Copy libraries
Verbose: File copied from "/media/imants/work/workplace/projects/lib.sdl2/bin/arm-android/libSDL2.so" to "/media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2.so"
Verbose: File copied from "/media/imants/work/workplace/projects/lib.sdl2/bin/arm-android/libSDL2_image.so" to "/media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_image.so"
Verbose: File copied from "/media/imants/work/workplace/projects/lib.sdl2/bin/arm-android/libSDL2_mixer.so" to "/media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_mixer.so"
Verbose: File copied from "/media/imants/work/workplace/projects/lib.sdl2/bin/arm-android/libSDL2_net.so" to "/media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_net.so"
Verbose: File copied from "/media/imants/work/workplace/projects/lib.sdl2/bin/arm-android/libSDL2_ttf.so" to "/media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_ttf.so"
Verbose: File copied from "/media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/dist/arm-android/libexample.so" to "/media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libmain.so"
Progress: Android Dir: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/
Verbose: Copying resources
Warning: Project icon did not found. Using lazarus icon
Verbose: Copying Java source
Verbose: Android min. target SDK: android-19
Verbose: Android target SDK: android-21
Progress: Building android
Progress:
Verbose: Buildfile: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/build.xml
Verbose:
Verbose: -set-mode-check:
Verbose:
Verbose: -set-debug-files:
Verbose:
Verbose: -check-env:
Verbose:  [checkenv] Android SDK Tools Revision 25.1.6
Verbose:  [checkenv] Installed at /media/imants/work/workplace/libs/android-sdk-linux24.4.1
Verbose:
Verbose: -setup:
Verbose:      [echo] Project Name: OpenGL Test
Verbose:   [gettype] Project Type: Application
Verbose:
Verbose: -set-debug-mode:
Verbose:
Verbose: -debug-obfuscation-check:
Verbose:
Verbose: -pre-build:
Verbose:
Verbose: -build-setup:
Verbose: [getbuildtools] Using latest Build Tools: 23.0.3
Verbose:      [echo] Resolving Build Target for OpenGL Test...
Verbose: [gettarget] Project Target:   Android 5.0.1
Verbose: [gettarget] API level:        21
Verbose:      [echo] ----------
Verbose:      [echo] Creating output directories if needed...
Verbose:     [mkdir] Created dir: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin
Verbose:     [mkdir] Created dir: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/res
Verbose:     [mkdir] Created dir: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/rsObj
Verbose:     [mkdir] Created dir: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/rsLibs
Verbose:     [mkdir] Created dir: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/classes
Verbose:     [mkdir] Created dir: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/dexedLibs
Verbose:      [echo] ----------
Verbose:      [echo] Resolving Dependencies for OpenGL Test...
Verbose: [dependency] Library dependencies:
Verbose: [dependency] No Libraries
Verbose: [dependency]
Verbose: [dependency] ------------------
Verbose:      [echo] ----------
Verbose:      [echo] Building Libraries with 'debug'...
Verbose:    [subant] No sub-builds to iterate on
Verbose:
Verbose: -code-gen:
Verbose: [mergemanifest] Merging AndroidManifest files into one.
Verbose: [mergemanifest] Manifest merger disabled. Using project manifest only.
Verbose:      [echo] Handling aidl files...
Verbose:      [aidl] No AIDL files to compile.
Verbose:      [echo] ----------
Verbose:      [echo] Handling RenderScript files...
Verbose:      [echo] ----------
Verbose:      [echo] Handling Resources...
Verbose:      [aapt] Found modified input file
Verbose:      [aapt] Generating resource IDs...
Verbose:      [echo] ----------
Verbose:      [echo] Handling BuildConfig class...
Verbose: [buildconfig] Generating BuildConfig class.
Verbose:
Verbose: -pre-compile:
Verbose:
Verbose: -compile:
Verbose:     [javac] Compiling 4 source files to /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/classes
Verbose:     [javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
Verbose:     [javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
Verbose:     [javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Verbose:     [javac] Note: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/src/org/libsdl/app/SDLActivity.java uses or overrides a deprecated API.
Verbose:     [javac] Note: Recompile with -Xlint:deprecation for details.
Verbose:     [javac] 3 warnings
Verbose:
Verbose: -post-compile:
Verbose:
Verbose: -obfuscate:
Verbose:
Verbose: -dex:
Verbose:       [dex] input: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/classes
Verbose:       [dex] Converting compiled files and external libraries into /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/classes.dex...
Verbose:
Verbose: -crunch:
Verbose:    [crunch] Crunching PNG Files in source dir: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/res
Verbose:    [crunch] To destination dir: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/res
Verbose:    [crunch] Processing image to cache: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/res/drawable-hdpi/icon.png => /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/res/drawable-hdpi/icon.png
Verbose:    [crunch]   (processed image to cache entry /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/res/drawable-hdpi/icon.png: 70% size of source)
Verbose:    [crunch] Processing image to cache: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/res/drawable-ldpi/icon.png => /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/res/drawable-ldpi/icon.png
Verbose:    [crunch]   (processed image to cache entry /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/res/drawable-ldpi/icon.png: 0% size of source)
Verbose:    [crunch] Processing image to cache: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/res/drawable-mdpi/icon.png => /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/res/drawable-mdpi/icon.png
Verbose:    [crunch]   (processed image to cache entry /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/res/drawable-mdpi/icon.png: 0% size of source)
Verbose:    [crunch] Crunched 3 PNG files to update cache
Verbose:
Verbose: -package-resources:
Verbose:      [aapt] Creating full resource package...
Verbose:
Verbose: -package:
Verbose: [apkbuilder] Current build type is different than previous build: forced apkbuilder run.
Verbose: [apkbuilder] Creating OpenGL Test-debug-unaligned.apk and signing it with a debug key...
Verbose:
Verbose: -post-package:
Verbose:
Verbose: -do-debug:
Verbose:  [zipalign] Running zip align on final apk...
Verbose:      [echo] Debug Package: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/OpenGL Test-debug.apk
Verbose: [propertyfile] Creating new property file: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/build.prop
Verbose: [propertyfile] Updating property file: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/build.prop
Verbose: [propertyfile] Updating property file: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/build.prop
Verbose: [propertyfile] Updating property file: /media/imants/work/workplace/projects/lib.sdl2/examples/sdl_android/lib/arm-android/android/bin/build.prop
Verbose:
Verbose: -post-build:
Verbose:
Verbose: debug:
Verbose:
Verbose: BUILD SUCCESSFUL
Verbose: Total time: 10 seconds
Verbose: Adb: /media/imants/work/workplace/libs/android-sdk-linux24.4.1/platform-tools/adb
Verbose: List of devices attached
Warning: No device found could not install apk file

mewpokemon

  • New Member
  • *
  • Posts: 29
Re: LazSDL2 package for Android development
« Reply #10 on: June 30, 2016, 12:14:24 am »
Here are my messages.

Code: [Select]
Hint: (11030) Start of reading config file /etc/fpc.cfg
Hint: (11031) End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 3.0.0 [2016/06/08] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
(1002) Target OS: Android for ARMEL
(3104) Compiling example.lpr
(3104) Compiling mainwnd.pas
/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/mainwnd.pas(18,32) Hint: (5024) Parameter "Sender" not used
/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/mainwnd.pas(19,42) Hint: (5024) Parameter "Sender" not used
/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/mainwnd.pas(20,34) Hint: (5024) Parameter "Sender" not used
/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/mainwnd.pas(21,38) Hint: (5024) Parameter "Sender" not used
/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/mainwnd.pas(22,33) Hint: (5024) Parameter "Sender" not used
(9009) Assembling mainwnd
/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/example.lpr(8,3) Hint: (5023) Unit "jni" not used in example
/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/example.lpr(8,8) Hint: (5023) Unit "ctypes" not used in example
/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/example.lpr(8,16) Hint: (5023) Unit "SDL.Android.NativeActivity" not used in example
/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/example.lpr(8,44) Hint: (5023) Unit "SDL.Android.Logger" not used in example
/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/example.lpr(13,38) Hint: (5023) Unit "SDL.Extended.Interfaces" not used in example
/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/example.lpr(14,3) Hint: (5023) Unit "SDL.Extended.Types" not used in example
(9009) Assembling example
(9022) Compiling resource /home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/lib/arm-android/example.or
(9015) Linking /home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/dist/arm-android/libexample.so

(1008) 229 lines compiled, 4.2 sec
(1022) 13 hint(s) issued
Messages
Verbose: Creating project directory Structure
Verbose: Directory created: /home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/lib/arm-android/android/libs/armeabi
Verbose: Directory created: /home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/lib/arm-android/android/src
Verbose: Copy libraries
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.1/bin/arm-android/libSDL2.so" to "/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2.so"
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.1/bin/arm-android/libSDL2_image.so" to "/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_image.so"
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.1/bin/arm-android/libSDL2_mixer.so" to "/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_mixer.so"
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.1/bin/arm-android/libSDL2_net.so" to "/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_net.so"
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.1/bin/arm-android/libSDL2_ttf.so" to "/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_ttf.so"
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/dist/arm-android/libexample.so" to "/home/daniel/lazarus/sdl2-1.3.1/examples/sdl_android/lib/arm-android/android/libs/armeabi/libmain.so"

It seems it stops just before "Copying resources" and should have output "Progress: Android Dir: ...".  I can't tell what might be wrong.

Imants

  • Full Member
  • ***
  • Posts: 181
Re: LazSDL2 package for Android development
« Reply #11 on: June 30, 2016, 07:58:04 am »
It was bug from my part a very noob like bug  :-[
But thanks to you I found it :)

Here are quick fix for the shameful bug I hope you will give a try :)

https://files.inbox.lv/ticket/6f945cd6823da2df7c7f0474d91b0ac3ab5c0fdb/sdl2-1.3.2.tgz
https://files.inbox.lv/ticket/19ff398b2a5001e668f15543e6947a450eb8948a/sdl2-1.3.2.zip

mewpokemon

  • New Member
  • *
  • Posts: 29
Re: LazSDL2 package for Android development
« Reply #12 on: July 01, 2016, 12:58:03 am »
Still no luck.  It fails like so:

Code: [Select]
Compile Project, Mode: Android, OS: android, CPU: arm, Target: dist/arm-android/libexample.so: Success
Messages, Errors: 1, Warnings: 1
Verbose: Creating project directory Structure
Verbose: Directory created: /home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/lib/arm-android/android/libs/armeabi
Verbose: Directory created: /home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/lib/arm-android/android/src
Verbose: Copy libraries
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.2/bin/arm-android/libSDL2.so" to "/home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2.so"
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.2/bin/arm-android/libSDL2_image.so" to "/home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_image.so"
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.2/bin/arm-android/libSDL2_mixer.so" to "/home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_mixer.so"
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.2/bin/arm-android/libSDL2_net.so" to "/home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_net.so"
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.2/bin/arm-android/libSDL2_ttf.so" to "/home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libSDL2_ttf.so"
Verbose: File copied from "/home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/dist/arm-android/libexample.so" to "/home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/lib/arm-android/android/libs/armeabi/libmain.so"
Progress: Android Dir: /home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/lib/arm-android/android/
Verbose: Copying resources
Warning: Project icon did not found. Using lazarus icon
Verbose: Copying Java source
Verbose: Android min. target SDK: android-16
Verbose: Android target SDK: android-16
Progress: Building android
Progress:
Verbose: Buildfile: /home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/lib/arm-android/android/build.xml
Verbose:
Verbose: -set-mode-check:
Verbose:
Verbose: -set-debug-files:
Verbose:
Verbose: -check-env:
Verbose:  [checkenv] Android SDK Tools Revision 25.1.7
Verbose:  [checkenv] Installed at /home/daniel/android-sdk-linux
Verbose:
Verbose: -setup:
Verbose:      [echo] Project Name: OpenGL Test
Verbose:   [gettype] Project Type: Application
Verbose:
Verbose: -set-debug-mode:
Verbose:
Verbose: -debug-obfuscation-check:
Verbose:
Verbose: -pre-build:
Verbose:
Verbose: -build-setup:
Verbose: [getbuildtools] Using latest Build Tools: 24.0.0
Verbose:      [echo] Resolving Build Target for OpenGL Test...
Verbose:
Verbose: BUILD FAILED
Verbose: /home/daniel/android-sdk-linux/tools/ant/build.xml:538: Unable to resolve project target 'android-16'
Verbose:
Verbose: Total time: 1 second
Error: Could not copy file "/home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/lib/arm-android/android/bin/OpenGL Test-debug.apk" to "/home/daniel/lazarus/sdl2-1.3.2/examples/sdl_android/dist/arm-android/OpenGL Test-debug.apk". (2)

I tried with the version set to android-19 and still no good. 

In the bulid.xml file on line 538 it says
Code: [Select]
minSdkVersionOut="project.minSdkVersion"
Should it say?
Code: [Select]
minSdkVersionOut="${project.minSdkVersion}"
I wonder because the other place it references that it uses that syntax.  I don't know anything about ant and build.xml though.

Almost there...

Imants

  • Full Member
  • ***
  • Posts: 181
Re: LazSDL2 package for Android development
« Reply #13 on: July 01, 2016, 07:45:33 am »
Go to Lazarus->Tools->Options..->SDL2->General and press Update SDK button.
Then Android SDK manager will pop up. Install Android 4.1.2 (API 16) -> SDK Platform package.

mewpokemon

  • New Member
  • *
  • Posts: 29
Re: LazSDL2 package for Android development
« Reply #14 on: July 01, 2016, 09:11:47 am »
Dang!  I thought I'd done that.  Doing so certainly fixes the .apk build problems.  Unfortunately, I'm having trouble with getting USB devices to work with the VM so adb can't see the tablet and the build process can't install the .apk.

I transferred the .apk file over to the host system (Windows...  *sigh*) and used adb to install it.  When I run it, a black screen appears for a brief moment and then the application "exits".

When I check the logs, I can see that SDL is initialising correctly and I'm getting the SDL_Android_Init() message but the SDL thread simply exits soon after and the activity ends.

Is the example application meant to do something other than this or is it just for debugging to show that an activity can be run?

 

TinyPortal © 2005-2018