Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android application fails to find the native libraries after I added ApplicationManifest.xml
Forum Updated to NodeBB v4.3 + New Features

Android application fails to find the native libraries after I added ApplicationManifest.xml

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 3 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Violet Giraffe
    wrote on last edited by Violet Giraffe
    #1

    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.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Violet Giraffe
      wrote on last edited by
      #2

      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.

      zappy.mansZ 1 Reply Last reply
      0
      • V Violet Giraffe

        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.

        zappy.mansZ Offline
        zappy.mansZ Offline
        zappy.mans
        wrote on last edited by
        #3

        @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 ?

        1 Reply Last reply
        0
        • B Offline
          B Offline
          Befoulot
          wrote on last edited by
          #4

          @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?

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved