You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kivy crashes on Android: ImportError: dlopen failed: library "libpython3.7m.so" not found #2237
This line works OK on the computer and in several Phones:
def open_settings(self):
from controller.settings import Settings
On a Huawei that line throws the following error on ADB logcat:
06-12 19:39:53.265 10723 10762 I python : ImportError: dlopen failed: library "libpython3.7m.so" not found
buildozer.spec
Just a standard spec file, nothing special. The same spec file works on other phones.
Command:
from controller.settings import Settings
Logs
06-12 19:39:53.261 10723 10762 I python : File "/data/data/org.test.test_buddy.myapp/files/app/view/welcome.kv", line 46, in
06-12 19:39:53.263 10723 10762 I python : on_release: root.open_settings()
06-12 19:39:53.263 10723 10762 I python : File "./controller/welcome.py", line 21, in open_settings
06-12 19:39:53.265 10723 10762 I python : from controller.settings import Settings
06-12 19:39:53.265 10723 10762 I python : ImportError: dlopen failed: library "libpython3.7m.so" not found
06-12 19:39:53.265 10723 10762 I python : Python for android ended.
Please the build log and the buildozer.spec, the kivy versions and target Python versions you shared gave me some doubts.
Also please try with recent build artifacts and tell us how it runs: https://github.com/kivy/python-for-android/actions/runs/131218787
Try both bdist_test_app_unittests__armeabi-v7a-debug-1.1.apk and bdist_test_app_unittests__arm64-v8a-debug-1.1.apk
By the way, these kind of errors that happen only on a given device are usually hard to fix if we can't reproduce it. So if this really happens because of the device, best would be that you investigate and fix it
Build log:
Removed all the Copy and Create lines for privacy.
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Programa de gestión de paquetes de Debian `dpkg' versión 1.19.0.5 (amd64).
Esto es software libre; consulte la Licencia Pública General de GNU versión 2 o
posterior para conocer las condiciones de copia. No hay NINGUNA garantía.
# Search for Git (git)
# -> found at /usr/bin/git
# Search for Cython (cython)
# -> found at /home/.local/bin/cython
# Search for Java compiler (javac)
# -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
# -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
# Install platform
# Run 'git config --get remote.origin.url'
# Cwd /home/.buildozer/android/platform/python-for-android
https://github.com/kivy/python-for-android.git
# Run 'git branch -vv'
# Cwd /home/.buildozer/android/platform/python-for-android
* master b1f6064d [origin/master] Release 2019.10.06 (#1998)
# Run '/usr/bin/python3 -m pip install -q --user \'appdirs\' \'colorama>=0.3.3\' \'jinja2\' \'six\' \'enum34; python_version<"3.4"\' \'sh>=1.10; sys_platform!="nt"\' \'pep517<0.7.0"\' \'pytoml\' \'virtualenv\''
# Cwd None
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
# Apache ANT found at /home/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/.buildozer/android/platform/android-sdk
# Recommended android's NDK version by p4a is: 19b
# Android NDK found at /home/.buildozer/android/platform/android-ndk-r19b
# Check application requirements
# Check garden requirements
# Garden requirements already installed, pass
# Compile platform
[INFO]: Will compile for the following archs: armeabi-v7a
[INFO]: Found Android API target in $ANDROIDAPI: 27
[INFO]: Available Android APIs are (27)
[INFO]: Requested API target 27 is available, continuing.
[INFO]: Found NDK dir in $ANDROIDNDK: /home/.buildozer/android/platform/android-ndk-r19b
[INFO]: Found NDK version 19b
[INFO]: Getting NDK API version (i.e. minimum supported API) from user argument
[INFO]: Found virtualenv at /home/.local/bin/virtualenv
[INFO]: ccache is missing, the build will not be optimized in the future.
[INFO]: Found the following toolchain versions: ['4.9']
[INFO]: Picking the latest gcc toolchain, here 4.9
[INFO]: Of the existing distributions, the following meet the given requirements:
[INFO]: myapp: min API 21, includes recipes (hostpython3, libffi, openssl, sdl2_image, sdl2_mixer, sdl2_ttf, sqlite3, python3, sdl2, setuptools, six, pyjnius, android, kivy), built for archs (armeabi-v7a)
[INFO]: myapp has compatible recipes, using this one
# Build the application #68
[INFO]: Will compile for the following archs: armeabi-v7a
[INFO]: Found Android API target in $ANDROIDAPI: 27
[INFO]: Available Android APIs are (27)
[INFO]: Requested API target 27 is available, continuing.
[INFO]: Found NDK dir in $ANDROIDNDK: /home/
[INFO]: Found NDK version 19b
[INFO]: Getting NDK API version (i.e. minimum supported API) from user argument
[INFO]: Found virtualenv at /home/.local/bin/virtualenv
[INFO]: ccache is missing, the build will not be optimized in the future.
[INFO]: Found the following toolchain versions: ['4.9']
[INFO]: Picking the latest gcc toolchain, here 4.9
[INFO]: Of the existing distributions, the following meet the given requirements:
[INFO]: myapp: min API 21, includes recipes (hostpython3, libffi, openssl, sdl2_image, sdl2_mixer, sdl2_ttf, sqlite3, python3, sdl2, setuptools, six, pyjnius, android, kivy), built for archs (armeabi-v7a)
[INFO]: myapp has compatible recipes, using this one
[INFO]: Of the existing distributions, the following meet the given requirements:
[INFO]: myapp: min API 21, includes recipes (hostpython3, libffi, openssl, sdl2_image, sdl2_mixer, sdl2_ttf, sqlite3, python3, sdl2, setuptools, six, pyjnius, android, kivy), built for archs (armeabi-v7a)
[INFO]: myapp has compatible recipes, using this one
[INFO]: -> directory context /.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a
[INFO]: Selecting java build tool:
[INFO]: Detected highest available build tools version to be 30.0.0-rc2
[INFO]: Building with gradle, as gradle executable is present
[DEBUG]: -> running gradlew assembleDebug
[DEBUG]:
[DEBUG]: BUILD SUCCESSFUL in 4s
[DEBUG]: 27 actionable tasks: 4 executed, 23 up-to-date
[INFO]: <- directory context /home/.buildozer/android/platform/python-for-android
[INFO]: # Copying APK to current directory
[INFO]: # APK filename not found in build output. Guessing...
[INFO]: # Found APK file: /home/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/build/outputs/apk/debug/myapp__armeabi-v7a-debug.apk
[INFO]: # Add version number to APK
[INFO]: # APK renamed to myapp__armeabi-v7a-debug-2.0-.apk
[DEBUG]: -> running cp /home/.buildozer/android/platform/build-armeabi-v7a/dists/myapp__armeabi-v7a/build/outputs/apk/debug/myapp__armeabi-v7a-debug.apk myapp__armeabi-v7a-debug-2.0-.apk
WARNING: Received a --sdk argument, but this argument is deprecated and does nothing.
No compiled python is present to zip, skipping.
No setup.py/pyproject.toml used, copying full private data into .apk.
Applying Java source code patches...
Applying patch: src/patches/SDLActivity.java.patch
Warning: failed to apply patch (exit code 1), assuming it is already applied: src/patches/SDLActivity.java.patch
# Android packaging done!
Activity
AndreMiras commentedon Jun 13, 2020
Please the build log and the
buildozer.spec, the kivy versions and target Python versions you shared gave me some doubts.Also please try with recent build artifacts and tell us how it runs:
https://github.com/kivy/python-for-android/actions/runs/131218787
Try both bdist_test_app_unittests__armeabi-v7a-debug-1.1.apk and bdist_test_app_unittests__arm64-v8a-debug-1.1.apk
By the way, these kind of errors that happen only on a given device are usually hard to fix if we can't reproduce it. So if this really happens because of the device, best would be that you investigate and fix it
chavarinbonbyn commentedon Jun 16, 2020
Here is the info requested.
Removed all the Copy and Create lines for privacy.
RobertFlatt commentedon Jun 17, 2020
From the log
From the .spec
This is a really old version of p4a, not the master version.
Explains why the the message is Python3.7 not Python 3.8
But not why the message occurs, or why 'master' is not 2020.6.2
misl6 commentedon May 31, 2023
Closing as the issue looks related to an old version of
python-for-android(we're now targetingPython==3.10)To the original author: feel free to re-open the issue if it persists with the new
python-for-androidrelease.