Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kivy .so is too small to be an ELF executable [pygame bootstrap] #897

Closed
KeyWeeUsr opened this issue Oct 8, 2016 · 3 comments
Closed

Kivy .so is too small to be an ELF executable [pygame bootstrap] #897

KeyWeeUsr opened this issue Oct 8, 2016 · 3 comments

Comments

@KeyWeeUsr
Copy link
Contributor

KeyWeeUsr commented Oct 8, 2016

For unknown reason to me this happens:

V/python  ( 7992): extracting include/python2.7/pyconfig.h (last extracting log)
W/ResourceType( 7992): No package identifier when getting value for resource number 0x00000000
D/dalvikvm( 7992): Trying to load lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl.so 0x427a4
220
D/dalvikvm( 7992): Added shared lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl.so 0x427a422
0
D/dalvikvm( 7992): Trying to load lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_image.so 0
x427a4220
D/dalvikvm( 7992): Added shared lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_image.so 0x4
27a4220
D/dalvikvm( 7992): No JNI_OnLoad found in /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_image.
so 0x427a4220, skipping init
D/dalvikvm( 7992): Trying to load lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_ttf.so 0x4
27a4220
D/dalvikvm( 8103): JIT code cache reset in 0 ms (0 bytes 2/0)
D/dalvikvm( 8103): GC_CONCURRENT freed 306K, 12% free 11633K/13172K, paused 6ms+4ms, total 67ms
D/dalvikvm( 7992): Added shared lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_ttf.so 0x427
a4220
D/dalvikvm( 7992): No JNI_OnLoad found in /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_ttf.so
 0x427a4220, skipping init
D/dalvikvm( 7992): Trying to load lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_mixer.so 0
x427a4220
D/dalvikvm( 7992): Added shared lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_mixer.so 0x4
27a4220
D/dalvikvm( 7992): No JNI_OnLoad found in /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_mixer.
so 0x427a4220, skipping init
D/dalvikvm( 7992): Trying to load lib /data/app-lib/org.kivy.testlauncher_pygame-1/libpython2.7.so 0
x427a4220
D/dalvikvm( 7992): Added shared lib /data/app-lib/org.kivy.testlauncher_pygame-1/libpython2.7.so 0x4
27a4220
D/dalvikvm( 7992): No JNI_OnLoad found in /data/app-lib/org.kivy.testlauncher_pygame-1/libpython2.7.
so 0x427a4220, skipping init
D/dalvikvm( 7992): Trying to load lib /data/app-lib/org.kivy.testlauncher_pygame-1/libapplication.so
 0x427a4220
D/dalvikvm( 7992): Added shared lib /data/app-lib/org.kivy.testlauncher_pygame-1/libapplication.so 0
x427a4220
D/dalvikvm( 7992): No JNI_OnLoad found in /data/app-lib/org.kivy.testlauncher_pygame-1/libapplicatio
n.so 0x427a4220, skipping init
D/dalvikvm( 7992): Trying to load lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_main.so 0x
427a4220
D/dalvikvm( 7992): Added shared lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_main.so 0x42
7a4220
D/dalvikvm( 7992): No JNI_OnLoad found in /data/app-lib/org.kivy.testlauncher_pygame-1/libsdl_main.s
o 0x427a4220, skipping init
D/dalvikvm( 7992): Trying to load lib /data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/li
b-dynload/_io.so 0x427a4220
D/dalvikvm( 7992): Added shared lib /data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/lib-
dynload/_io.so 0x427a4220
D/dalvikvm( 7992): No JNI_OnLoad found in /data/data/org.kivy.testlauncher_pygame/files/lib/python2.
7/lib-dynload/_io.so 0x427a4220, skipping init
D/dalvikvm( 7992): Trying to load lib /data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/li
b-dynload/unicodedata.so 0x427a4220
D/dalvikvm( 7992): Added shared lib /data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/lib-
dynload/unicodedata.so 0x427a4220
D/dalvikvm( 7992): No JNI_OnLoad found in /data/data/org.kivy.testlauncher_pygame/files/lib/python2.
7/lib-dynload/unicodedata.so 0x427a4220, skipping init
D/dalvikvm( 7992): Trying to load lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsqlite3.so 0x4
27a4220
D/dalvikvm( 7992): Added shared lib /data/app-lib/org.kivy.testlauncher_pygame-1/libsqlite3.so 0x427
a4220
D/dalvikvm( 7992): No JNI_OnLoad found in /data/app-lib/org.kivy.testlauncher_pygame-1/libsqlite3.so
 0x427a4220, skipping init
D/dalvikvm( 7992): Trying to load lib /data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/li
b-dynload/_sqlite3.so 0x427a4220
E/dalvikvm( 7992): dlopen("/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/lib-dynload/_
sqlite3.so") failed: dlopen failed: library "/data/data/org.kivy.testlauncher_pygame/files/lib/pytho
n2.7/lib-dynload/_sqlite3.so" not found
D/dalvikvm( 7992): Trying to load lib /data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/li
b-dynload/_imaging.so 0x427a4220
E/dalvikvm( 7992): dlopen("/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/lib-dynload/_
imaging.so") failed: dlopen failed: library "/data/data/org.kivy.testlauncher_pygame/files/lib/pytho
n2.7/lib-dynload/_imaging.so" not found
I/python  ( 7992): Starting audio thread
I/libSDL  ( 7992): Physical screen resolution is 1280x720
I/python  ( 7992): Initialize Python for Android
D/dalvikvm( 8103): GC_CONCURRENT freed 491K, 13% free 11655K/13380K, paused 3ms+2ms, total 78ms
D/dalvikvm( 8103): WAIT_FOR_CONCURRENT_GC blocked 65ms
D/dalvikvm( 8103): GC_CONCURRENT freed 515K, 14% free 11652K/13400K, paused 2ms+2ms, total 39ms
D/dalvikvm( 8103): WAIT_FOR_CONCURRENT_GC blocked 32ms
D/dalvikvm( 8103): GC_CONCURRENT freed 507K, 14% free 11656K/13400K, paused 3ms+1ms, total 28ms
D/dalvikvm( 8103): WAIT_FOR_CONCURRENT_GC blocked 16ms
D/dalvikvm( 8103): GC_CONCURRENT freed 519K, 14% free 11648K/13400K, paused 2ms+2ms, total 24ms
D/dalvikvm( 8103): WAIT_FOR_CONCURRENT_GC blocked 19ms
I/python  ( 7992): ['/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/site-packages', '/d
ata/data/org.kivy.testlauncher_pygame/files/lib/site-python']
I/python  ( 7992): Android path ['/data/data/org.kivy.testlauncher_pygame/files/lib/python27.zip', '
/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7', '/data/data/org.kivy.testlauncher_pyga
me/files/lib/python2.7/lib-dynload', '/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/si
te-packages', '/storage/emulated/0/kivy/old KivyShowcase', '/data/data/org.kivy.testlauncher_pygame/
files/lib/python2.7/site-packages/PIL']
I/python  ( 7992): Android kivy bootstrap done. __name__ is __main__
I/python  ( 7992): Run user program, change dir and execute main.py
D/dalvikvm( 8103): GC_CONCURRENT freed 502K, 13% free 11658K/13400K, paused 1ms+1ms, total 24ms
D/dalvikvm( 8103): WAIT_FOR_CONCURRENT_GC blocked 19ms
D/dalvikvm( 8103): GC_CONCURRENT freed 518K, 14% free 11653K/13404K, paused 2ms+2ms, total 24ms
D/dalvikvm( 8103): WAIT_FOR_CONCURRENT_GC blocked 19ms
D/dalvikvm( 8103): GC_CONCURRENT freed 507K, 14% free 11657K/13404K, paused 1ms+1ms, total 23ms
D/dalvikvm( 8103): WAIT_FOR_CONCURRENT_GC blocked 19ms
D/dalvikvm( 8103): GC_CONCURRENT freed 513K, 14% free 11656K/13404K, paused 1ms+2ms, total 25ms
D/dalvikvm( 8103): WAIT_FOR_CONCURRENT_GC blocked 20ms
I/SELinux ( 8126): Function: selinux_android_load_priority [0], There is no sepolicy file.
I/SELinux ( 8126):
I/SELinux ( 8126): Function: selinux_android_load_priority , spota verifySig and checkHash pass. pri
ority version is VE=SEPF_GT-N7100_4.4.2_0040
I/SELinux ( 8126):
I/SELinux ( 8126):
I/SELinux ( 8126): selinux_android_seapp_context_reload: seapp_contexts file is loaded from /data/se
curity/spota/seapp_contexts
I/python  ( 7992): [ERROR  ] Error when copying logo directory
I/python  ( 7992): Traceback (most recent call last):
I/python  ( 7992):   File "/home/kivy/.local/share/python-for-android/dists/launchertest_pygame/priv
ate/lib/python2.7/site-packages/kivy/__init__.py", line 306, in <module>
I/python  ( 7992):   File "/home/kivy/.local/share/python-for-android/build/other_builds/python2-sql
ite3/armeabi/python2/python-install/lib/python2.7/shutil.py", line 205, in copytree
I/python  ( 7992): Error: [('/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/site-packag
es/kivy/data/logo/kivy-icon-24.png', u'/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-ico
n-24.png', "[Errno 1] Operation not permitted: '/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon
/kivy-icon-24.png'"), ('/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/site-packages/ki
vy/data/logo/kivy-icon-128.png', u'/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-icon-12
8.png', "[Errno 1] Operation not permitted: '/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/ki
vy-icon-128.png'"), ('/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/site-packages/kivy
/data/logo/kivy-icon-512.png', u'/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-icon-512.
png', "[Errno 1] Operation not permitted: '/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy
-icon-512.png'"), ('/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/site-packages/kivy/d
ata/logo/kivy-icon-32.png', u'/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-icon-32.png'
, "[Errno 1] Operation not permitted: '/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-ico
n-32.png'"), ('/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/site-packages/kivy/data/l
ogo/kivy-icon-48.png', u'/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-icon-48.png', "[E
rrno 1] Operation not permitted: '/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-icon-48.
png'"), ('/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/site-packages/kivy/data/logo/k
ivy-icon-64.png', u'/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-icon-64.png', "[Errno
1] Operation not permitted: '/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-icon-64.png'"
), ('/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/site-packages/kivy/data/logo/kivy-i
con-256.png', u'/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-icon-256.png', "[Errno 1]
Operation not permitted: '/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-icon-256.png'"),
 ('/data/data/org.kivy.testlauncher_pygame/files/lib/python2.7/site-packages/kivy/data/logo/kivy-ico
n-16.png', u'/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-icon-16.png', "[Errno 1] Oper
ation not permitted: '/storage/emulated/0/kivy/old KivyShowcase/.kivy/icon/kivy-icon-16.png'"), '/da
ta/data/org.kivy.testlauncher_pygame/files/lib/python2.7/site-packages/kivy/data/logo', u'/storage/e
mulated/0/kivy/old KivyShowcase/.kivy/icon', "[Errno 1] Operation not permitted: '/storage/emulated/
0/kivy/old KivyShowcase/.kivy/icon'"]
I/python  ( 7992): [WARNING] [Config      ] Older configuration version detected (0 instead of 16)
I/python  ( 7992): [WARNING] [Config      ] Upgrading configuration in progress.
I/python  ( 7992): [INFO   ] [Logger      ] Record log in /storage/emulated/0/kivy/old KivyShowcase/
.kivy/logs/kivy_16-10-08_0.txt
I/python  ( 7992): [INFO   ] [Kivy        ] v1.9.2-dev0
I/python  ( 7992): [INFO   ] [Python      ] v2.7.2 (default, Oct  8 2016, 17:57:44)
I/python  ( 7992): [GCC 4.6 20120106 (prerelease)]
I/python  ( 7992):  Traceback (most recent call last):
I/python  ( 7992):    File "main.py", line 4, in <module>
I/python  ( 7992):      from kivy.properties import NumericProperty
I/python  ( 7992):  ImportError: dlopen failed: "/data/data/org.kivy.testlauncher_pygame/files/lib/p
ython2.7/site-packages/kivy/properties.so" is too small to be an ELF executable
D/dalvikvm( 8126): JIT code cache reset in 0 ms (0 bytes 2/0)
D/dalvikvm( 8126): GC_CONCURRENT freed 471K, 13% free 11593K/13296K, paused 4ms+2ms, total 34ms
D/dalvikvm( 8126): WAIT_FOR_CONCURRENT_GC blocked 21ms
I/python  ( 7992): Python for android ended.
I/AndroidRuntime( 7992): VM exiting with result code 0, cleanup skipped.

compiled via the test setup with:

options = {'apk': {'debug': None,
                   'bootstrap': 'pygame',
                   'launcher': None,
                   'requirements': (
                        'python2,pygame,'
                        'sqlite3,docutils,pygments,kivy,pyjnius,plyer,'
                        'audiostream,cymunk,lxml,pil,'  # ffmpeg, openssl
                        'twisted,numpy'),  # pyopenssl
                   'android-api': 14,
                   'dist-name': 'launchertest_pygame',
                   'ndk-version': 'r8c',
                   'name': 'TestLauncher-pygame',
                   'package': 'org.kivy.testlauncher_pygame',
                   'icon': 'testapps/testlauncher_setup/launcher-icon.png',
                   'presplash':
                       'testapps/testlauncher_setup/launcher-presplash.jpg',
                   'permission': 'ACCESS_COARSE_LOCATION',
                   'permission': 'ACCESS_FINE_LOCATION',
                   'permission': 'BLUETOOTH',
                   'permission': 'BODY_SENSORS',
                   'permission': 'CAMERA',
                   'permission': 'INTERNET',
                   'permission': 'NFC',
                   'permission': 'READ_EXTERNAL_STORAGE',
                   'permission': 'RECORD_AUDIO',
                   'permission': 'USE_FINGERPRINT',
                   'permission': 'VIBRATE',
                   'permission': 'WAKE_LOCK',
                   'permission': 'WRITE_EXTERNAL_STORAGE',
                   }}

ref #887 (comment)

@inclement
Copy link
Member

I infer this doesn't happen without your changes? Are you able to try building with different combinations to isolate the exact cause of the problem?

@KeyWeeUsr
Copy link
Contributor Author

No, it doesn't have anything to do with sdl2_launcher branch. Installed directly from master:

sudo pip uninstall python-for-android &&
sudo pip install https://github.com/kivy/python-for-android/zipball/master &&
p4a apk --bootstrap=pygame --launcher --requirements=python2,pygame,sqlite3,docutils,pygments,kivy,pyjnius,plyer,audiostream,cymunk,lxml,pil,twisted,numpy --package=org.test.kivylauncher --version=1.0 --name=TestLauncher

@KeyWeeUsr
Copy link
Contributor Author

This broke it: 7c1da72 see 98ce8bd#diff-80fe12080634c195316be23301e86be0R21 for the change. I added app as the path changed, but ANDROID_APP_PATH needs to be customizable, therefore no bindings should be allowed to such variable before python is actually run on the device. This happens during the compilation (too soon). Path is the same, variable not (critical).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants