question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need libpython3.7m.so.1.0 in android phone

See original GitHub issue

Hello. I build with this instruction:

https://groups.google.com/forum/#!topic/kivy-users/Lf4zlYmLVPo

Apk compiled and builded. After setup and launch in my Android phone, I have a error:

SDL Error

An error occurred while trying to start the applicaion. Please try again and/or reinstall.
Error: dl open failed: could not load library: "libpython3.7m.so.1.0" needed by "libmain.so"; caused by library "libpython3.7m.so.1.0" not foud

log from logcat:

V/pythonutil(11885): Checking pattern libcrystax\.so against libSDL2_mixer.so
V/pythonutil(11885): Checking pattern libcrystax\.so against libSDL2_ttf.so
V/pythonutil(11885): Checking pattern libcrystax\.so against libmain.so
V/pythonutil(11885): Checking pattern libcrystax\.so against libSDL2.so
V/pythonutil(11885): Checking pattern libcrystax\.so against libSDL2_image.so
V/pythonutil(11885): Checking pattern libcrystax\.so against libpython3.7m.so
V/pythonutil(11885): Checking pattern libsqlite3\.so against libSDL2_mixer.so
V/pythonutil(11885): Checking pattern libsqlite3\.so against libSDL2_ttf.so
V/pythonutil(11885): Checking pattern libsqlite3\.so against libmain.so
V/pythonutil(11885): Checking pattern libsqlite3\.so against libSDL2.so
V/pythonutil(11885): Checking pattern libsqlite3\.so against libSDL2_image.so
V/pythonutil(11885): Checking pattern libsqlite3\.so against libpython3.7m.so
V/pythonutil(11885): Checking pattern libssl.*\.so against libSDL2_mixer.so
V/pythonutil(11885): Checking pattern libssl.*\.so against libSDL2_ttf.so
V/pythonutil(11885): Checking pattern libssl.*\.so against libmain.so
V/pythonutil(11885): Checking pattern libssl.*\.so against libSDL2.so
V/pythonutil(11885): Checking pattern libssl.*\.so against libSDL2_image.so
V/pythonutil(11885): Checking pattern libssl.*\.so against libpython3.7m.so
V/pythonutil(11885): Checking pattern libcrypto.*\.so against libSDL2_mixer.so
V/pythonutil(11885): Checking pattern libcrypto.*\.so against libSDL2_ttf.so
V/pythonutil(11885): Checking pattern libcrypto.*\.so against libmain.so
V/pythonutil(11885): Checking pattern libcrypto.*\.so against libSDL2.so
V/pythonutil(11885): Checking pattern libcrypto.*\.so against libSDL2_image.so
V/pythonutil(11885): Checking pattern libcrypto.*\.so against libpython3.7m.so
V/pythonutil(11885): Loading library: SDL2
V/pythonutil(11885): Loading library: SDL2_image
V/pythonutil(11885): Loading library: SDL2_mixer
V/pythonutil(11885): Loading library: SDL2_ttf
V/pythonutil(11885): Loading library: python2.7
V/pythonutil(11885): Library loading error: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.kivymd.test-1/base.apk"],nativeLibraryDirectories=[/data/app/com.kivymd.test-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libpython2.7.so"
V/pythonutil(11885): Loading library: python3.5m
V/pythonutil(11885): Library loading error: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.kivymd.test-1/base.apk"],nativeLibraryDirectories=[/data/app/com.kivymd.test-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libpython3.5m.so"
V/pythonutil(11885): Loading library: python3.6m
V/pythonutil(11885): Library loading error: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.kivymd.test-1/base.apk"],nativeLibraryDirectories=[/data/app/com.kivymd.test-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libpython3.6m.so"
V/pythonutil(11885): Loading library: python3.7m
V/pythonutil(11885): Loading library: main
E/art     (11885): dlopen("/data/app/com.kivymd.test-1/lib/arm/libmain.so", RTLD_LAZY) failed: dlopen failed: could not load library "libpython3.7m.so.1.0" needed by "libmain.so"; caused by library "libpython3.7m.so.1.0" not found
V/pythonutil(11885): Library loading error: dlopen failed: could not load library "libpython3.7m.so.1.0" needed by "libmain.so"; caused by library "libpython3.7m.so.1.0" not found
V/pythonutil(11885): An UnsatisfiedLinkError occurred loading main
W/System.err(11885): dlopen failed: could not load library "libpython3.7m.so.1.0" needed by "libmain.so"; caused by library "libpython3.7m.so.1.0" not found``` 

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:26 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
opacamcommented, Jan 6, 2019

Ok, I solved the linkage problem with libpython3.7.so.1.0, and @inclement was in the right direction:

…the Java method called to load the libraries automatically finds them and only supports a .so suffix

So…there is no way that the java loader can load a versioned library…therefore… is no problem with gradle, is our build method what is causing the problems, but this can be easily solved by forcing that the python library gets built without the version, so this way we will have the proper suffix, and we will avoid all this linkage problems.

The fix is already applied in pr #1537, but here I leave a link to a patch that will solve the problem for the current master branch: https://gist.github.com/opacam/10cef1ca8182a39b9e5ebffe0adcdc90#file-fix-python3-linkage-patch

1reaction
ghostcommented, Dec 8, 2018

@inclement the exact environment p4a-py3-api28ndk21’s details are specified here:

https://github.com/JonasT/p4a-build-spaces/blob/master/environments/p4a-py3-api28ndk21/Dockerfile

Edit: I don’t know if it’s a generic problem, because I haven’t tried any other environment with the python3 recipe. I use python3crystax with the TLS hack rebuild usually, which has no such issues but I guess that’s also packaged differently

Please also note that sudo p4aspaces shell p4a-py3-api28ndk21 --p4a master gives you, after some build waiting time, a bash with everything isolated & installed in the affected versions in docker (needs docker installed of course). Just in case that would help with debugging. I can also assist with that on discord if that helps, both debugging and launching the environment

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error loading shared library libpython3.7m.so.1.0: No such file ...
sudo apt-get install libpython3.x-dev. This way you won't need to any changes to environment path manually.
Read more >
Python library not found: libpython3.7.so.1.0, libpython3.7m.so ...
This would mean your Python installation doesn't come with proper library files. This usually happens by missing development package, or ...
Read more >
file having issues with libpython3.7m.so.1.0 - Steam Community
If I try to just run the file from file manager, it doesn't do anything. Instead, I tried to run it from terminal,...
Read more >
https://people.freebsd.org/~amdmi3/python-update.log
(cached) no checking aligned memory access is required... no checking for ... ln -f libpython3.7m.so.1.0 libpython3.7m.so; else cc -pthread -shared ...
Read more >
Message "error while loading shared libraries: libpython3.7m ...
Message "error while loading shared libraries: libpython3.7m.so.1.0: xxx" Is Displayed · Symptom · Solution.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found