Android application fails to find the native libraries after I added ApplicationManifest.xml
-
This is probably related to the package name. After I added the manifest with the default package name
org.qtproject.example
, I get this error on startup:E AndroidRuntime: FATAL EXCEPTION: main E AndroidRuntime: Process: org.qtproject.example, PID: 6433 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.qtproject.example-1/base.apk"],nativeLibraryDirectories=[/data/app/org.qtproject.example-1/lib/arm, /data/app/org.qtproject.example-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "lib.so" E AndroidRuntime: at java.lang.Runtime.loadLibrary(Runtime.java:367)
Follow up: the path ("/data/app/org.qtproject.example-1/lib/arm") is correct and it does change properly if I edit the package name. It's
lib.so
that's the problem: the actual library name islib<app_name>.so
, but it looks forlib.so
. If I rename the library, the app can start successfully.I also noticed And an unrelated issue that doesn't seem to be worth its own topic: somehow the application name is not displayed beneath the icon in the launcher. But it is displayed when the app crashes. How so?
Ideally, I'd like to specify my own package name, but at the very least I want to make the app work with a custom manifest. How can I fix this?Follow-up #2: I have fixed the missing launcher name by adding
android:label="My app name"
to the<activity>
entry in the manifest, but it's still trying to loadlib.so
instead oflibMyAppName.so
. -
Found the solution.
<meta-data android:name="android.app.lib_name" android:value="<MyAppName"/>
must be set (value was blank by default). Unfortunately, deleting this tag will not hint the system to take the app's name automatically, so this tag must be present and properly set. -
Found the solution.
<meta-data android:name="android.app.lib_name" android:value="<MyAppName"/>
must be set (value was blank by default). Unfortunately, deleting this tag will not hint the system to take the app's name automatically, so this tag must be present and properly set.@Violet-Giraffe Hello. I have a problem when loading native library from system/lib64. This is my post: https://forum.qt.io/topic/142803/native-library-directory-system-priv-app-qt-lib-arm64-does-not-exist-or-is-empty
Since you load the native library successfully, Could you help me resolve the problem ? -
@Violet-Giraffe said in Android application fails to find the native libraries after I added ApplicationManifest.xml:
I also noticed And an unrelated issue that doesn't seem to be worth its own topic: somehow the application name is not displayed beneath the icon in the launcher. But it is displayed when the app crashes. How so?
I also saw On the launcher, the programme name is not displayed beneath the icon, which appears to be an unrelated problem that does not seem to need its own subject. But, it appears when the app fails. How so?