Buldozer / Python for android error: _event.so" is too small to be an ELF executable

630 views
Skip to first unread message

Tom Geiger

unread,
May 7, 2014, 10:15:17 AM5/7/14
to kivy-...@googlegroups.com
Hi all,

i wrote a Kivy app that i used to package for android the old way with distribute.sh and build.py. I was using Kivy 1.7.2 and although it was not too convenient i managed to run it on my phone.
Now that i updated to Kivy 1.8.0 I tried bulldozer, and while the apk-package is actually built, i cannot run it in android. In logcat, the errror looks as follows:

...
...
I/python  ( 7279): Initialize Python for Android
I/ActivityManager( 7279): Timeline: Activity_idle id: android.os.BinderProxy@418ad848 time:2949294
I/python  ( 7279): ['/data/data/org.tgeiger.ltur/files/lib/python2.7/site-packages', '/data/data/org.tgeiger.ltur/files/lib/site-python']
I/python  ( 7279): Android path ['/data/data/org.tgeiger.ltur/files/lib/python27.zip', '/data/data/org.tgeiger.ltur/files/lib/python2.7', '/data/data/org.tgeiger.ltur/files/lib/python2.7/lib-dynload', '/data/data/org.tgeiger.ltur/files/lib/python2.7/site-packages', '/data/data/org.tgeiger.ltur/files', '/data/data/org.tgeiger.ltur/files/_applibs']
I/python  ( 7279): Android kivy bootstrap done. __name__ is __main__
I/python  ( 7279): Run user program, change dir and execute main.py
I/python  ( 7279): [INFO   ] Kivy v1.8.0-dev
I/python  ( 7279): [INFO   ] [Logger      ] Record log in /data/data/org.tgeiger.ltur/files/.kivy/logs/kivy_14-05-07_1.txt
I/python  ( 7279):  Traceback (most recent call last):
I/python  ( 7279):    File "/home/tom/workspace/python/scripts/ltur/.buildozer/android/app/main.py", line 4, in <module>
I/python  ( 7279):    File "/home/tom/workspace/python/scripts/ltur/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/screenmanager.py", line 144, in <module>
I/python  ( 7279):    File "/home/tom/workspace/python/scripts/ltur/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/event.py", line 8, in <module>
I/python  ( 7279):  ImportError: dlopen failed: "/data/data/org.tgeiger.ltur/files/lib/python2.7/site-packages/kivy/_event.so" is too small to be an ELF executable
I/python  ( 7279): Python for android ended.
I/AndroidRuntime( 7279): VM exiting with result code 0, cleanup skipped.
I/ActivityManager(  865): Process org.tgeiger.ltur:python (pid 7279) has died.
I/WindowState(  865): WIN DEATH: Window{4232cf68 u0 org.tgeiger.ltur/org.renpy.android.PythonActivity}
W/ActivityManager(  865): Force removing ActivityRecord{4195de78 u0 org.tgeiger.ltur/org.renpy.android.PythonActivity t17}: app died, no saved state
W/WindowManager(  865): Force-removing child win Window{428a1a20 u0 SurfaceView} from container Window{4232cf68 u0 org.tgeiger.ltur/org.renpy.android.PythonActivity}
W/WindowManager(  865): Failed looking up window
W/WindowManager(  865): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@42896ef0 does not exist
W/WindowManager(  865): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7968)
W/WindowManager(  865): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7959)
W/WindowManager(  865): at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1047)
W/WindowManager(  865): at android.os.BinderProxy.sendDeathNotice(Binder.java:493)
W/WindowManager(  865): at dalvik.system.NativeStart.run(Native Method)
I/WindowState(  865): WIN DEATH: null

Appenrently, there's something wrong with the _event.so file. When i checked my old dist - folders, i noticed that this file has always been 0 byte.

So I tried the old way, running 

./distribute.sh -m "sqlite3 kivy" 

but unfortunately i can't get it to work either:

...
...
 /home/tom/kivy_sdk/python-for-android-old/build/objects/surflock.so.o
 -L/home/tom/kivy_sdk_testing/python-for-android/build/libs
 -L/home/tom/kivy_sdk_testing/python-for-android/src/obj/local/armeabi/
 -lz
 -L/home/tom/kivy_sdk_testing/python-for-android/build/python-install/lib
 -lsdl
 -lm
 -lpython2.7
/home/tom/kivy_sdk/android-ndk-r8c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin//../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: cannot find -lpng
collect2: ld returned 1 exit status

I installed the libpng ubuntu package, and also tried ./distribute.sh -m "sqlite3 png kivy" with no success.

Any ideas on how to solve these issues (especially the bulldozer method, as i think it's a great improvement)

cheers
tom

Ben Rousch

unread,
May 7, 2014, 10:40:42 AM5/7/14
to kivy-...@googlegroups.com
Could you post your buildozer.spec?


--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
 Ben Rousch
   bro...@gmail.com
   http://clusterbleep.net/

Tom Geiger

unread,
May 8, 2014, 6:42:53 AM5/8/14
to kivy-...@googlegroups.com
This is my buildozer.spec

[app]

# (str) Title of your application
title = My Title

# (str) Package name
package.name = myapp

# (str) Package domain (needed for android/ios packaging)
package.domain = org.tgeiger

# (str) Source code where the main.py live
source.dir = .

# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas,txt,db

# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec

# (list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin

# (list) List of exclusions using pattern matching
#source.exclude_patterns = license,images/*/*.jpg

# (str) Application versioning (method 1)
#version.regex = __version__ = ['"](.*)'['"]
#version.filename = %(source.dir)s/main.py

# (str) Application versioning (method 2)
version = 0.7.0

# (list) Application requirements
requirements = sqlite3, kivy

# (list) Garden requirements
#garden_requirements =

# (str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png

# (str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png

# (str) Supported orientation (one of landscape, portrait or all)
orientation = all

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0


#
# Android specific
#

# (list) Permissions
android.permissions = INTERNET, WAKE_LOCK, VIBRATE

# (int) Android API to use
android.api = 14

# (int) Minimum API required (8 = Android 2.2 devices)
android.minapi = 8

# (int) Android SDK version to use
android.sdk = 21

# (str) Android NDK version to use
android.ndk = 9c

# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
android.ndk_path =

# (str) Android SDK directory (if empty, it will be automatically downloaded.)
android.sdk_path =

# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
android.p4a_dir =

# (list) python-for-android whitelist
#android.p4a_whitelist =

# (str) Android entry point, default is ok for Kivy-based app
android.entrypoint = org.renpy.android.PythonActivity

# (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar

# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
#android.add_src =

# (str) python-for-android branch to use, if not master, useful to try
# not yet merged features.
#android.branch = master

# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME

# (str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png

# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =

# (list) Android additionnal libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
#android.add_libs_x86 = libs/android-x86/*.so
#android.add_libs_mips = libs/android-mips/*.so

# (bool) Indicate whether the screen should stay on
# Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False

# (list) Android application meta-data to set (key=value format)
#android.meta_data =

# (list) Android library project to add (will be added in the
# project.properties automatically.)
#android.library_references =

#
# iOS specific
#

# (str) Name of the certificate to use for signing the debug version
# Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"

# (str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s


[buildozer]

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 1


# -----------------------------------------------------------------------------
# List as sections
#
# You can define all the "list" as [section:key].
# Each line will be considered as a option to the list.
# Let's take [app] / source.exclude_patterns.
# Instead of doing:
#
#     [app]
#     source.exclude_patterns = license,data/audio/*.wav,data/images/original/*
#
# This can be translated into:
#
#     [app:source.exclude_patterns]
#     license
#     data/audio/*.wav
#     data/images/original/*
#


# -----------------------------------------------------------------------------
# Profiles
#
# You can extend section / key with a profile
# For example, you want to deploy a demo version of your application without
# HD content. You could first change the title to add "(demo)" in the name
# and extend the excluded directories to remove the HD content.
#
#     [app@demo]
#     title = My Application (demo)
#
#     [app:source.exclude_patterns@demo]
#     images/hd/*
#
# Then, invoke the command line with the "demo" profile:
#
#     buildozer --profile demo android debug 

Ben Rousch

unread,
May 8, 2014, 9:03:15 AM5/8/14
to kivy-...@googlegroups.com
I can't find any problem and can't replicate it using the current stable buildozer. My only advice is to uninstall buildozer, delete  ~/.buildozer, delete the .buildozer dir in your project, re-install buildozer, and try it again. 


--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Geiger

unread,
May 8, 2014, 2:44:02 PM5/8/14
to kivy-...@googlegroups.com
There must be some problem with my underlying Ubuntu / Python installation. I tried it on a different computer and there was no error, the package was built and worked.

Thanks

Ben Rousch

unread,
May 8, 2014, 2:58:33 PM5/8/14
to kivy-...@googlegroups.com
That's interesting. Could you give some more details about your setup (Ubuntu version, Python version, how you installed Kivy)?


On Thu, May 8, 2014 at 2:44 PM, Tom Geiger <tom.f...@googlemail.com> wrote:
There must be some problem with my underlying Ubuntu / Python installation. I tried it on a different computer and there was no error, the package was built and worked.

Thanks

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Geiger

unread,
May 9, 2014, 6:59:06 AM5/9/14
to kivy-...@googlegroups.com
First i had installed kivy using the 1.8.0 tarball and "sudo python setup.py install", the same way i did with the 1.7.2 package earlier. Afterwards I tried the python-kivy ubuntu package with the same results.

I'm using Ubuntu 12.10. 

Python 2.7.3 (default, Feb 27 2014, 19:37:34) 
[GCC 4.7.2] on linux2

[INFO   ] Kivy v1.8.0

>>> cython.__version__
'0.20.1

I attached the verbose output from the buildozer build process, maybe there's some information in it that you can use.
Since I have used Python in many different projects, it might just be the case that i misconfigured it in some place in the course of time.
buildozer_log.zip

Gaurav Trivedi

unread,
May 9, 2014, 5:54:26 PM5/9/14
to kivy-...@googlegroups.com
Hi,

I am facing this same issue. I have tried both buildozer and python for android (not that it would have made any difference, but I can confirm that P4A had been working previously). With both, I get the spit the following error:

I/python  (20467):  ImportError: dlopen failed: "/data/data/org.test.tst/files/lib/python2.7/site-packages/kivy/_event.so" is too small to be an ELF executable
I/python  (20467): Python for android ended.

I also had a linker problem and symbols not being read correctly when I tried P4A. I was able to solve that by upgrading my NDK from r7 to r9.

Thanks,

Gaurav

Gaurav Trivedi

unread,
May 10, 2014, 4:37:57 PM5/10/14
to kivy-...@googlegroups.com
I have created https://github.com/kivy/python-for-android/issues/234 to track this issue.

Gaurav

Gaurav Trivedi

unread,
May 10, 2014, 11:09:20 PM5/10/14
to kivy-...@googlegroups.com
My issue got resolved when I updated my OSX to 10.9.2 along with the new developer tools.

@Tom: If you are on Mac, I am guessing one of the updates in between broke something.

Gaurav

Tom Geiger

unread,
May 23, 2014, 9:31:42 AM5/23/14
to kivy-...@googlegroups.com
Gaurav, thanks a lot for investigating the issue in https://github.com/kivy/python-for-android/issues/234

It helped me to get rid of the error by deleting the P4A_kivy_DIR Variable in my .bashrc file. The app runs fine now. 

Gaurav Trivedi

unread,
May 23, 2014, 10:04:59 AM5/23/14
to kivy-...@googlegroups.com
Tom, Akshay (quanon) has further narrowed this issue. You can work around this issue by deleting the build/ directory from your  P4A_kivy_DIR
every time you create a distribution. Make sure you clean your P4A directory (builds and dists) as well before you do this the first time.

I think they are working on a fix for this and create a PR soon.


--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/jvnpObU-Ukc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.

Milos Bulatovic

unread,
May 29, 2014, 4:19:29 AM5/29/14
to kivy-...@googlegroups.com
I have the same error and I
deleted the P4A_kivy_DIR variable from .bashrc,
executed "source ~/.bashrc",
deleted the .buildozer directory from my project and
issued "buildozer android debug".
And I still have the same error.

Ben Rousch

unread,
May 29, 2014, 6:39:37 AM5/29/14
to kivy-...@googlegroups.com

After removing the P4A_kivy_DIR you may need to restart your console session for it to take effect.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages