$ p4a apk --private /home/patrick/raspberry_pi/pi3d_demos/android/ --package=org.example.myapp --name "myapp" --version 0.2 --bootstrap=pygame --requirements=python2,kivy,pi3d --sdk_dir /home/patrick/Android/Sdk/ --ndk_dir /home/patrick/Downloads/android-ndk-r12b --android_api 19 --ndk_ver r12b --meta-data surface.depth=16
from pythonforandroid.toolchain import PythonRecipe
class Pi3dRecipe(PythonRecipe):
name = 'pi3d'
url = 'https://pypi.python.org/packages/e9/dd/25e942027895ba496acbad2b37432a40bac3a177acafed498ff1e171c6b3/pi3d-{version}.tar.gz'
version = '2.13'
depends = ['python2', 'kivy', 'pygame', 'numpy', 'pil']
recipe = Pi3dRecipe()
I/python ( 1470): Initialize Python for Android
I/python ( 1470): ['/data/data/org.example.myapp/files/lib/python2.7/site-packages', '/data/data/org.example.myapp/files/lib/site-python']
I/python ( 1470): Android path ['/data/data/org.example.myapp/files/lib/python27.zip', '/data/data/org.example.myapp/files/lib/python2.7', '/data/data/org.example.myapp/files/lib/python2.7/lib-dynload', '/data/data/org.example.myapp/files/lib/python2.7/site-packages', '/data/data/org.example.myapp/files', '/data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL']
I/python ( 1470): Android kivy bootstrap done. __name__ is __main__
I/python ( 1470): Run user program, change dir and execute main.py
I/python ( 1470): Traceback (most recent call last):
I/python ( 1470): File "/home/patrick/raspberry_pi/pi3d_demos/android/main.py", line 16, in <module>
I/python ( 1470): File "/home/patrick/.local/share/python-for-android/dists/unnamed_dist_1/private/lib/python2.7/site-packages/pi3d/__init__.py", line 10, in <module>
I/python ( 1470): File "/home/patrick/.local/share/python-for-android/dists/unnamed_dist_1/private/lib/python2.7/site-packages/pi3d/constants/__init__.py", line 168, in <module>
I/python ( 1470): File "/home/patrick/.local/share/python-for-android/dists/unnamed_dist_1/private/lib/python2.7/site-packages/pi3d/constants/__init__.py", line 166, in _detect_platform_and_load_libraries
I/python ( 1470): File "/home/patrick/.local/share/python-for-android/dists/unnamed_dist_1/private/lib/python2.7/site-packages/pi3d/constants/__init__.py", line 73, in _linux
I/python ( 1470): File "/home/patrick/.local/share/python-for-android/build/other_builds/python2/armeabi/python2/python-install/lib/python2.7/ctypes/__init__.py", line 10, in <module>
I/python ( 1470): ImportError: No module named _ctypes
I/python ( 1470): Python for android ended.
I/AndroidRuntime( 1470): VM exiting with result code 0, cleanup skipped.
D/dalvikvm( 5098): Trying to load lib /data/app-lib/org.example.myapp-1/libsqlite3.so 0xb1d448b0
D/dalvikvm( 5098): Added shared lib /data/app-lib/org.example.myapp-1/libsqlite3.so 0xb1d448b0
D/dalvikvm( 5098): No JNI_OnLoad found in /data/app-lib/org.example.myapp-1/libsqlite3.so 0xb1d448b0, skipping init
D/dalvikvm( 5098): Trying to load lib /data/data/org.example.myapp/files/lib/python2.7/lib-dynload/_sqlite3.so 0xb1d448b0
E/dalvikvm( 5098): dlopen("/data/data/org.example.myapp/files/lib/python2.7/lib-dynload/_sqlite3.so") failed: dlopen failed: library "/data/data/org.example.myapp/files/lib/python2.7/lib-dynload/_sqlite3.so" not found
D/dalvikvm( 5098): Trying to load lib /data/data/org.example.myapp/files/lib/python2.7/lib-dynload/_imaging.so 0xb1d448b0
E/dalvikvm( 5098): dlopen("/data/data/org.example.myapp/files/lib/python2.7/lib-dynload/_imaging.so") failed: dlopen failed: library "/data/data/org.example.myapp/files/lib/python2.7/lib-dynload/_imaging.so" not found
I/python ( 5098): Starting audio thread
I/libSDL ( 5098): Physical screen resolution is 1196x720
D/dalvikvm( 5098): GC_CONCURRENT freed 1470K, 41% free 3458K/5780K, paused 10ms+13ms, total 188ms
I/python ( 5098): Initialize Python for Android
I/python ( 5098): ['/data/data/org.example.myapp/files/lib/python2.7/site-packages', '/data/data/org.example.myapp/files/lib/site-python']
I/python ( 5098): Android path ['/data/data/org.example.myapp/files/lib/python27.zip', '/data/data/org.example.myapp/files/lib/python2.7', '/data/data/org.example.myapp/files/lib/python2.7/lib-dynload', '/data/data/org.example.myapp/files/lib/python2.7/site-packages', '/data/data/org.example.myapp/files', '/data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL']
I/python ( 5098): Android kivy bootstrap done. __name__ is __main__
I/python ( 5098): Run user program, change dir and execute main.py
D/dalvikvm( 3508): GC_CONCURRENT freed 456K, 16% free 3426K/4036K, paused 74ms+3ms, total 245ms
I/python ( 5098): [WARNING] [Config ] Older configuration version detected (0 instead of 16)
I/python ( 5098): 2016-08-27 18:16:02,212 WARNING: kivy: [Config ] Older configuration version detected (0 instead of 16)
I/python ( 5098): [WARNING] [Config ] Upgrading configuration in progress.
I/python ( 5098): 2016-08-27 18:16:02,225 WARNING: kivy: [Config ] Upgrading configuration in progress.
I/python ( 5098): [INFO ] [Logger ] Record log in /data/data/org.example.myapp/files/.kivy/logs/kivy_16-08-27_0.txt
I/python ( 5098): 2016-08-27 18:16:02,297 INFO: kivy: [Logger ] Record log in /data/data/org.example.myapp/files/.kivy/logs/kivy_16-08-27_0.txt
I/python ( 5098): [INFO ] [Kivy ] v1.9.2-dev0
I/python ( 5098): 2016-08-27 18:16:02,289 INFO: kivy: [Kivy ] v1.9.2-dev0
I/python ( 5098): [INFO ] [Python ] v2.7.2 (default, Aug 27 2016, 20:07:49)
I/python ( 5098): [GCC 4.9.x 20150123 (prerelease)]
I/python ( 5098): 2016-08-27 18:16:02,331 INFO: kivy: [Python ] v2.7.2 (default, Aug 27 2016, 20:07:49)
I/python ( 5098): [GCC 4.9.x 20150123 (prerelease)]
I/python ( 5098): [INFO ] [Factory ] 193 symbols loaded
I/python ( 5098): 2016-08-27 18:16:02,482 INFO: kivy: [Factory ] 193 symbols loaded
I/python ( 5098): /data/data/org.example.myapp/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:12: RuntimeWarning: import cdrom: No module named cdrom
I/python ( 5098): 2016-08-27 18:16:07,203 WARNING: kivy: stderr: /data/data/org.example.myapp/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:12: RuntimeWarning: import cdrom: No module named cdrom
I/python ( 5098): (ImportError: No module named cdrom)
I/python ( 5098): 2016-08-27 18:16:07,213 WARNING: kivy: stderr: (ImportError: No module named cdrom)
I/python ( 5098): [INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_pygame, img_pil (img_ffpyplayer ignored)
I/python ( 5098): 2016-08-27 18:16:07,333 INFO: kivy: [Image ] Providers: img_tex, img_dds, img_gif, img_pygame, img_pil (img_ffpyplayer ignored)
F/libc ( 5098): invalid address or address of corrupt block 0xb8726b78 passed to dlfree
F/libc ( 5098): Fatal signal 11 (SIGSEGV), thread 5112 (Thread-139)
I/DEBUG ( 50): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 50): Build fingerprint: 'generic/google_sdk/generic:4.4.2/KK/3079183:eng/test-keys'
I/DEBUG ( 50): Revision: '0'
I/DEBUG ( 50): pid: 5098, tid: 5112, name: Thread-139 >>> org.example.myapp:python <<<
I/DEBUG ( 50): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
I/DEBUG ( 50): Abort message: 'invalid address or address of corrupt block 0xb8726b78 passed to dlfree'
I/DEBUG ( 50): r0 00000000 r1 b6f0f1ae r2 deadbaad r3 b6f12d66
I/DEBUG ( 50): r4 b8726b78 r5 b6f1d158 r6 a697a000 r7 b8726b80
I/DEBUG ( 50): r8 b8626420 r9 a8b16bc0 sl 00000001 fp 00000000
I/DEBUG ( 50): ip 00000001 sp a79dde38 lr b6ee1593 pc b6ee1594 cpsr 68000030
I/DEBUG ( 50): d0 3fcc7288e957b53b d1 4008000000000000
I/DEBUG ( 50): d2 7e37e43c8800759c d3 7e37e43c8800759c
I/DEBUG ( 50): d4 0000000000000000 d5 3fbc71c71c71c71c
I/DEBUG ( 50): d6 3ff0000000000000 d7 3fc999999999999a
I/DEBUG ( 50): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 50): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 50): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 50): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 50): scr 20000010
I/DEBUG ( 50):
I/DEBUG ( 50): backtrace:
I/DEBUG ( 50): #00 pc 00011594 /system/lib/libc.so (dlfree+1191)
I/DEBUG ( 50): #01 pc 0000dafb /system/lib/libc.so (free+10)
I/DEBUG ( 50): #02 pc 00047ffd /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so (jpeg_free_small+4)
I/DEBUG ( 50): #03 pc 000471b5 /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so
I/DEBUG ( 50): #04 pc 0004723f /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so
I/DEBUG ( 50): #05 pc 00039719 /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so (jpeg_destroy+12)
I/DEBUG ( 50): #06 pc 0003c34b /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so (jpeg_destroy_decompress+2)
I/DEBUG ( 50): #07 pc 00027fe0 /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so (ImagingJpegDecode+448)
I/DEBUG ( 50):
I/DEBUG ( 50): stack:
I/DEBUG ( 50): a79dddf8 a8b16bc0 /data/app-lib/org.example.myapp-1/libpython2.7.so
I/DEBUG ( 50): a79dddfc 00000001
I/DEBUG ( 50): a79dde00 a79dde70 [stack:5112]
I/DEBUG ( 50): a79dde04 e2d32274
I/DEBUG ( 50): a79dde08 b8726b78 [heap]
I/DEBUG ( 50): a79dde0c b6f1d158
I/DEBUG ( 50): a79dde10 a697a000
I/DEBUG ( 50): a79dde14 b6ee2909 /system/lib/libc.so
I/DEBUG ( 50): a79dde18 b6f0f1ae /system/lib/libc.so
I/DEBUG ( 50): a79dde1c a79dde2c [stack:5112]
I/DEBUG ( 50): a79dde20 b6f12d66 /system/lib/libc.so
I/DEBUG ( 50): a79dde24 b6ee1593 /system/lib/libc.so (dlfree+1190)
I/DEBUG ( 50): a79dde28 b6f0f1ae /system/lib/libc.so
I/DEBUG ( 50): a79dde2c b8726b78 [heap]
I/DEBUG ( 50): a79dde30 df002777
I/DEBUG ( 50): a79dde34 e3a070ad
I/DEBUG ( 50): #00 a79dde38 b6f19000 /system/lib/libc.so
I/DEBUG ( 50): a79dde3c 0000070c
I/DEBUG ( 50): a79dde40 b8626420 [heap]
I/DEBUG ( 50): a79dde44 b8717e68 [heap]
I/DEBUG ( 50): a79dde48 b871d6d8 [heap]
I/DEBUG ( 50): a79dde4c b6eddafd /system/lib/libc.so (free+12)
I/DEBUG ( 50): #01 a79dde50 00000700
I/DEBUG ( 50): a79dde54 a7ff2001 /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so (jpeg_free_small+8)
I/DEBUG ( 50): #02 a79dde58 00000700
I/DEBUG ( 50): a79dde5c a7ff11b9 /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so
I/DEBUG ( 50):
I/DEBUG ( 50): memory near r1:
I/DEBUG ( 50): b6f0f18c 69747075 64206e6f 63657465 20646574
I/DEBUG ( 50): b6f0f19c 25207962 696c0073 6d5f6362 6f6c6c61
I/DEBUG ( 50): b6f0f1ac 6e690063 696c6176 64612064 73657264
I/DEBUG ( 50): b6f0f1bc 726f2073 64646120 73736572 20666f20
I/DEBUG ( 50): b6f0f1cc 72726f63 20747075 636f6c62 7025206b
I/DEBUG ( 50): b6f0f1dc 73617020 20646573 25206f74 616d0073
I/DEBUG ( 50): b6f0f1ec 79732078 6d657473 74796220 3d207365
[INFO]: Recipe build order is ['hostpython2', 'jpeg', 'png', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python2', 'numpy', 'pil', 'sdl2', 'six', u'pi3d', 'pyjnius', u'kivy']
E/libEGL ( 5255): eglQuerySurface:590 error 300d (EGL_BAD_SURFACE)
E/libEGL ( 5255): eglQuerySurface:590 error 300d (EGL_BAD_SURFACE)
E/EGL_emulation( 5255): tid 5269: eglMakeCurrent(980): error 0x3009 (EGL_BAD_MATCH)
E/libEGL ( 5255): eglMakeCurrent:775 error 3009 (EGL_BAD_MATCH)
F/libc ( 5255): invalid address or address of corrupt block 0xb88b25f8 passed to dlfree
F/libc ( 5255): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 5269 (SDLThread)
I/DEBUG ( 50): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 50): Build fingerprint: 'generic/google_sdk/generic:4.4.2/KK/3079183:eng/test-keys'
I/DEBUG ( 50): Revision: '0'
I/DEBUG ( 50): pid: 5255, tid: 5269, name: SDLThread >>> org.example.myapp <<<
I/DEBUG ( 50): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
I/DEBUG ( 50): Abort message: 'invalid address or address of corrupt block 0xb88b25f8 passed to dlfree'
I/DEBUG ( 50): r0 00000000
r1 b6f0f1ae r2 deadbaad r3 b6f12d66
I/DEBUG ( 50): r4 b88b25f8 r5 b6f1d158 r6 a6617000 r7 b88b2600
I/DEBUG ( 50): r8 b87aedd8 r9 a8ae2bc0 sl 00000001 fp 00000000
I/DEBUG ( 50): ip 00000001 sp a83d2ce8 lr b6ee1593 pc b6ee1594 cpsr 68000030
I/DEBUG ( 50): d0 421041306f800000 d1 4024000000000000
I/DEBUG ( 50): d2 4014000000000000 d3 3fe0000000000000
I/DEBUG ( 50): d4 0000000000000005 d5 4059000000000000
I/DEBUG ( 50): d6 3ff0000000000000 d7 3fe0000000000000
I/DEBUG ( 50): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 50): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 50): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 50): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 50): scr 20000010
I/DEBUG ( 50):
I/DEBUG ( 50): backtrace:
I/DEBUG ( 50): #00 pc 00011594 /system/lib/libc.so (dlfree+1191)
I/DEBUG ( 50): #01 pc 0000dafb /system/lib/libc.so (free+10)
I/DEBUG ( 50): #02 pc 00047ffd /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so (jpeg_free_small+4)
I/DEBUG ( 50): #03 pc 000471b5 /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so
I/DEBUG ( 50): #04 pc 0004723f /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so
I/DEBUG ( 50): #05 pc 00039719 /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so (jpeg_destroy+12)
I/DEBUG ( 50): #06 pc 0003c34b /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so (jpeg_destroy_decompress+2)
I/DEBUG ( 50): #07 pc 00027fe0 /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so (ImagingJpegDecode+448)
I/DEBUG ( 50):
I/DEBUG ( 50): stack:
I/DEBUG ( 50): a83d2ca8 a8ae2bc0 /data/app-lib/org.example.myapp-1/libpython2.7.so
I/DEBUG ( 50): a83d2cac 00000001
I/DEBUG ( 50): a83d2cb0 a83d2d20 [stack:5269]
I/DEBUG ( 50): a83d2cb4 e2d32274
I/DEBUG ( 50): a83d2cb8 b88b25f8 [heap]
I/DEBUG ( 50): a83d2cbc b6f1d158
I/DEBUG ( 50): a83d2cc0 a6617000 [anon:libc_malloc]
I/DEBUG ( 50): a83d2cc4 b6ee2909 /system/lib/libc.so
I/DEBUG ( 50): a83d2cc8 b6f0f1ae /system/lib/libc.so
I/DEBUG ( 50): a83d2ccc a83d2cdc [stack:5269]
I/DEBUG ( 50): a83d2cd0 b6f12d66 /system/lib/libc.so
I/DEBUG ( 50): a83d2cd4 b6ee1593 /system/lib/libc.so (dlfree+1190)
I/DEBUG ( 50): a83d2cd8 b6f0f1ae /system/lib/libc.so
I/DEBUG ( 50): a83d2cdc b88b25f8 [heap]
I/DEBUG ( 50): a83d2ce0 b6f12d66 /system/lib/libc.so
I/DEBUG ( 50): a83d2ce4 b88b2df0 [heap]
I/DEBUG ( 50): #00 a83d2ce8 b6f19000 /system/lib/libc.so
I/DEBUG ( 50): a83d2cec 0000070c
I/DEBUG ( 50): a83d2cf0 b87aedd8 [heap]
I/DEBUG ( 50): a83d2cf4 b88b1d78 [heap]
I/DEBUG ( 50): a83d2cf8 b887f398 [heap]
I/DEBUG ( 50): a83d2cfc b6eddafd /system/lib/libc.so (free+12)
I/DEBUG ( 50): #01 a83d2d00 00000700
I/DEBUG ( 50): a83d2d04 a7716001 /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so (jpeg_free_small+8)
I/DEBUG ( 50): #02 a83d2d08 00000700
I/DEBUG ( 50): a83d2d0c a77151b9 /data/data/org.example.myapp/files/lib/python2.7/site-packages/PIL/_imaging.so
I/DEBUG ( 50):
I/DEBUG ( 50): memory near r1:
[DEBUG]: _imaging.c: In function '_putdata':
[DEBUG]: _imaging.c:1322:17: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
[DEBUG]: image->image32[y][x] = *((INT32*) ink);
[DEBUG]: ^
[DEBUG]: _imaging.c: In function '_filter':
[DEBUG]: _imaging.c:842:8: warning: 'kernelsize' may be used uninitialized in this function [-Wmaybe-uninitialized]
[DEBUG]: if (kernelsize != xsize * ysize) {
[DEBUG]: ^
| ||
However the original PIL code worked when I used p4a last year so the change in behaviour must be because of some change in the way that the code is being integrated. Did there used to be something in the old-style recipe that needs to be added to the new one? |