-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
*.so is too small to be an ELF executable #234
Comments
Since I was able to build APKs successfully before (it has recently stopped working), I had the helloworld example of an APK (built on my same system) that worked fine. I have uploaded them in case it helps. Working fine - http://ge.tt/1CwVwah1/v/0 And here's the folder diff output between these two packages: https://gist.github.com/trivedigaurav/2e657dc5f995be6a5729 |
I tried to build a distribution using the Ubuntu VM provided in the downloads section on the kivy website as well. I get a very similar error there as well:
This confirms that this is not a mac specific issue. Also, here's the log while creating a distribution using disitribute.sh: http://pastebin.com/LgfZPE1s; It looks like that it may be due an error in the kivy code. |
I am to confirm that I see these errors when I use the local copy of the Kivy code by setting $P4A_kivy_DIR variable. The APKs run just fine when using the default kivy version in P4A (by not setting the variable). This probably suggests this issue may be moved to kivy/kivy. Thanks to @brousch for helping me confirm these. |
I am able to replicate this problem by using the P4A_kivy_DIR environment variable. When using a local kivy clone and that environment setting, the APK is built, but crashes on Android with the "too small to be an ELF error". Additionally, the APKs generated using a local Kivy clone and barebones Hello World program are about 5.6MB. APKs created using the normal python-for-android downloaded Kivy end up around 6.3MB. My best guess is that python-for-android is doing something different when downloading and extracting Kivy compared to when it's using a local clone. Here is an APK generated using P4A_kivy_DIR with a local Kivy clone with the 1.8.0 branch checked out: https://www.dropbox.com/s/zugkjaydvtk9t4e/HelloWorld-1.0-debug-local.apk Here is an APK generated using the normal python-for-android Kivy download of the stable branch: https://www.dropbox.com/s/uc6dgxiekmbvmj3/HelloWorld-1.0-debug-normal.apk |
FYI - this usually happens for me when there is a C extension conflict. C module names (NOT including namespace!) must be unique. So, for example, if you have Things get even trickier with pure C (non-Cython) extensions, like FWIW we always use |
I can now reliably reproduce and fix this bug using plain python-for-android and buildozer. Buildozer:
python-for-android
|
I've narrowed the problem further. You only need to delete the dist directory to trigger it. In buildozer, that's .buildozer/android/platform/python-for-android/dist and in python-for-android that's dist. |
@brousch I am able to reproduce this issue (ie. create a distribution that makes an apk with ELF errors) with the following steps using python-for-android:
In order to create, a working distribution you need to follow all of the above steps but without the P4A variable set. Remember to source bashrc again or open a new terminal. My guess is that we may have introduced the problem mentioned by @kived between the stable version of kivy and now. |
@akshayaurora has further narrowed this issue. You can work around this issue by deleting the build/ directory from your P4A_kivy_DIR before you create a distribution. Make sure you clean your P4A directory (builds and dists) as well before you do this the first time. |
The problem seems to definitely be that the object files in an existing build directory are not packed properly into libpymodules.so - you can see by comparison of apk sizes, a working apk is about 0.7MB larger, and unpacking reveals this difference is all in libpymodules.so. Checking that with objdump, sure enough the not working one doesn't include everything from kivy. I still don't know why (looking into it still), but adding that here in case it helps anyone. |
I think I tracked this down to being related to the most recent change in the kivy recipe, replacing 'cython' with '$CYTHON' which is really 'cython -t'. Does anyone else find that reverting that change makes things work again? I asked tito about it (copied below to not forget...), and he gave directions to investigate further so I'll keep going - the correct fix is probably not to revert the above change (it should work) but to fix something else that causes the problem.
Of these, I think biglink is fine - the kivy files are already missing from the argument directory passed to it. I pasted the files it sees at http://inclem.net/files/kivy/biglink_sofiles.txt . |
I did a pr for a fix, but it needs some discussion and confirmation about what's really going on - I wrote my semi-speculation there, but I don't follow all the technical details and it might be the wrong way to change things. |
Hi, I have the same error when I set P4A_pyjinius_DIR. |
I am running into the same error with NO P4A_kivy_DIR set. #251 did not fix it. |
I finally found what triggered this error in my case: pyyaml. Actually the pyyaml recipe. After removing it from p4a ( I tested on Ubuntu 14.04 and OSX 10.10.2 with a minimal hello world example: https://gist.github.com/cbenhagen/e16da236c3aa821d0a81 |
I get the same problem when building ( and running ) the compass example of kivy from a fresh git checkout creating build/lib.linux-x86_64-2.7/jnius To avoid The UserWarning I patched pyjnius/setup.py by --- pyjnius/master/setup.orig.py 2015-06-27 17:53:45.939286150 +0200
and run distribute.sh -m "setuptools kivy" Now I get the build error I tested on gentoo with these settings Check environment The touchtracer example works. |
@dl1ksv yours is a different error than the original one in this issue the original issue happens on device when the build is not recompiled which should not happen anymore cause we force recompilation. Your issue which is raised while compiling is most probably cause of issues with python installation being broken, @ecdsa found out that this was the cause of a similar error as yours. He solved the issue with installing python using |
Running a packaged kivy app on Android causes: "ImportError: dlopen failed: "/data/data/org.test.sms/files/lib/python2.7/site-packages/kivy/properties.so" is too small to be an ELF executable.
Run Log (using logcat): https://gist.github.com/trivedigaurav/74197a06807c4abdb485
Build Log (using P4A): https://gist.github.com/trivedigaurav/8203502e17bd1cf52e31
Related:
The text was updated successfully, but these errors were encountered: