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

APK crash: couldn't find "libpython3.7m.so #1133

Closed
Hr2944 opened this issue May 30, 2020 · 9 comments
Closed

APK crash: couldn't find "libpython3.7m.so #1133

Hr2944 opened this issue May 30, 2020 · 9 comments

Comments

@Hr2944
Copy link

Hr2944 commented May 30, 2020

Versions

  • Python: 3.7
  • OS: Ubuntu 18.04.3 LTS
  • Buildozer: 1.1.0

Description

I have compiled the apk without problems or any errors, but when it run under android, it crash. Errors messages couldn't find "libpython3.5m.so"/"libpython3.6m.so"/"libpython3.7m.so" are in logcat, but I don't known why I get these errors.

buildozer.spec

Command:

buildozer android debug deploy run

Spec file:

https://pastebin.com/Z88T9qer

Logcat

https://pastebin.com/TriqjJbd
@st-den
Copy link
Contributor

st-den commented May 31, 2020

Not sure if there is a problem here (why Python 3.7 doesn't load?), but I have the same errors as you, while having Python 3.8 installed, and everything works.

See the last few lines in my log:

05-31 17:23:10.926 25943 25943 V pythonutil: Loading library: python3.5m
05-31 17:23:10.927 25943 25943 V pythonutil: Library loading error: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/org.hematogender.camera_example-TlngvL56J2pwjcevmsyHHw==/base.apk"],nativeLibraryDirectories=[/data/app/org.hematogender.camera_example-TlngvL56J2pwjcevmsyHHw==/lib/arm, /data/app/org.hematogender.camera_example-TlngvL56J2pwjcevmsyHHw==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libpython3.5m.so"
05-31 17:23:10.927 25943 25943 V pythonutil: Loading library: python3.6m
05-31 17:23:10.927 25943 25943 V pythonutil: Library loading error: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/org.hematogender.camera_example-TlngvL56J2pwjcevmsyHHw==/base.apk"],nativeLibraryDirectories=[/data/app/org.hematogender.camera_example-TlngvL56J2pwjcevmsyHHw==/lib/arm, /data/app/org.hematogender.camera_example-TlngvL56J2pwjcevmsyHHw==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libpython3.6m.so"
05-31 17:23:10.927 25943 25943 V pythonutil: Loading library: python3.7m
05-31 17:23:10.928 25943 25943 V pythonutil: Library loading error: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/org.hematogender.camera_example-TlngvL56J2pwjcevmsyHHw==/base.apk"],nativeLibraryDirectories=[/data/app/org.hematogender.camera_example-TlngvL56J2pwjcevmsyHHw==/lib/arm, /data/app/org.hematogender.camera_example-TlngvL56J2pwjcevmsyHHw==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libpython3.7m.so"
05-31 17:23:10.928 25943 25943 V pythonutil: Loading library: python3.8m <<<
05-31 17:23:10.930 25943 25943 V pythonutil: Loading library: main <<<
05-31 17:23:10.931 25943 25943 V pythonutil: Loaded everything! <<<
05-31 17:23:10.983 25943 26013 I python  : Initializing Python for Android

@Hr2944
Copy link
Author

Hr2944 commented May 31, 2020

I was thinking that my apk crash because of this error, I don't known why it crash and I don't found any other errors. Is there anything that is strange in my logs?

@st-den
Copy link
Contributor

st-den commented May 31, 2020

Having read your logs twice, I can't spot an error. Except that in my case Python loads, and in yours it doesn't seem like it is the case. Have you tried installing Python 3.8?

@Hr2944
Copy link
Author

Hr2944 commented May 31, 2020

I just realize that I have many Python version (3.6, 3.7 and 2.7) installed, eventually Buildozer don't use the good one. I will try building with unique version and observe what happen.

@st-den
Copy link
Contributor

st-den commented May 31, 2020

My guess is that you have python3 in your requirements, and the current version in the repos is 3.8.x. I am not experienced enough to explain why you need the latest (or even if you need it), but I can guarantee it works fine for me this way. Maybe P4A you have installed requires 3.8, can't tell.

You can read more about it here:
#988 (comment)

@Hr2944
Copy link
Author

Hr2944 commented Jun 1, 2020

How do you install buildozer with python 3.8? Kivy only support 3.7.

@st-den
Copy link
Contributor

st-den commented Jun 1, 2020

kivy==2.0.0rc2 in requirements

@Hr2944
Copy link
Author

Hr2944 commented Jun 1, 2020

Ok, I finnaly found why it's not starting. I have made apk with differents architectures and differents python version, that change nothing. The problem was in my app, it don't recognize my files (I have ui_elements/Buttons and when importing it raise AttributeError: module 'ui_elements' has no attribute 'Button')
But now I see these errors using Android Studio logcat:

com.hugoriou.accountpointer E/libEGL: validate_display:108 error 3008 (EGL_BAD_DISPLAY)

com.hugoriou.accountpointer E/linker: library "/system/lib/libc.so" ("/system/lib/libc.so") needed or dlopened by "/data/data/com.hugoriou.accountpointer/files/app/_python_bundle/modules/_ctypes.cpython-38.so" is not accessible for the namespace: [name="(default)", ld_library_paths="", default_library_paths="/system/lib64:/product/lib64", permitted_paths="/system/lib64/drm:/system/lib64/extractors:/system/lib64/hw:/system/product/lib64:/system/framework:/system/app:/system/priv-app:/vendor/framework:/vendor/app:/vendor/priv-app:/odm/framework:/odm/app:/odm/priv-app:/oem/app:/system/product/framework:/system/product/app:/system/product/priv-app:/data:/mnt/expand:/system/hwemui/aimodel/library:/product/etc/aimodel/library:/product/region_comm/china/aimodel/library:/product/region_comm/oversea/aimodel/library:/product/lib64/drm:/preas"]

Do you known what it mean?
And if someone read this, use Android Studio builtin logcat viewer rather than adb logcat and filtering output, I don't know why but it works really better.

@Julian-O
Copy link
Contributor

This appears to be a support issue that has been answered.

We try to use GitHub Issues only to track work for developers to do to fix bugs and add new features to Buildozer.

This issue is being closed, because it doesn't describe a bug in Buildozer.

If you have further support questions, please don't post them here. Instead, there is a mailing list and a Discord channel to support Kivy users debugging their own systems, which should be able to help. They are linked in the ReadMe. For building Android apps, there is an unofficial Buildozer Users' Guide that has a lot of useful debugging tips.

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

3 participants