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 is lib<app_name>.so, but it looks for lib.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 load lib.so instead of libMyAppName.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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.