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. How to add custom library to Android application?
Forum Updated to NodeBB v4.3 + New Features

How to add custom library to Android application?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 2 Posters 1.3k 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.
  • P Offline
    P Offline
    Pablez
    wrote on 26 Feb 2020, 07:27 last edited by
    #1

    Hi,

    I am developing a movile application using Qt 5.14.1 for Android and the application crashes on startup when running the arm64-v8a abi. It works fine if I run the armeabi-v7a abi on the same device, but I need to make it work with the 64 bits version. The error is the following one:

    E vndksupport: Could not load vendor/lib64/egl/libGLES_mali.so from sphal namespace: dlopen failed: library "vendor/lib64/egl/libGLES_mali.so" not found.

    I think it has to do with the fact that Since Android 7.0 it's not possible anymore to link against a non-ndk shared library (but I don't understand why it works with the armeabi-v7a abi).

    Anyway, I have tried different ways to include the libGLES_mali.so library into the apk but I am not able to solve the problem. Anyone can help me?

    Thanks,

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 26 Feb 2020, 08:10 last edited by
      #2

      You can use ANDROID_EXTRA_LIBS variable in .pro file to link additional libraries. It works for all architectures.

      (Z(:^

      P 1 Reply Last reply 26 Feb 2020, 08:22
      2
      • S sierdzio
        26 Feb 2020, 08:10

        You can use ANDROID_EXTRA_LIBS variable in .pro file to link additional libraries. It works for all architectures.

        P Offline
        P Offline
        Pablez
        wrote on 26 Feb 2020, 08:22 last edited by
        #3

        @sierdzio I've already done it and the library is included into the libs folder of the android build, but not into the apk.

        1 Reply Last reply
        1
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 26 Feb 2020, 08:30 last edited by
          #4

          No idea then, it works for me (with OpenSSL, protobuf and yaml-cpp libs). Perhaps your AndroidManifest is outdated? Or you replace ANDROID_EXTRA_LIBS value somewhere else (Qt Creator sometimes appends empty call to extra libs in main .pro file)?

          (Z(:^

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Pablez
            wrote on 26 Feb 2020, 10:45 last edited by
            #5

            OK, now I can add the library into the apk. The problem was that I didn't have the 64 bit version of the library. However, I am still getting the error because the application keeps looking for the library on the "vendor/lib64/egl/" folder. Is there any way to modify this and use the library file I am installing with the apk?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 26 Feb 2020, 10:58 last edited by
              #6

              I don't know.

              (Z(:^

              1 Reply Last reply
              0

              2/6

              26 Feb 2020, 08:10

              4 unread
              • Login

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