Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-101346

Qt for Android has "weired" dependency on ICU, and deploy is slightly broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 6.2.3
    • Build System
    • None
    • Android

    Description

      I'm building Qt 6.2.3 on Ubuntu 20.04 x86_64 for the host and for Android. I use a number of external third-party dependencies like libpng, libtiff, libjpeg-turbo, and ICU. This usually works fine on the host. In the Android-build I can see that after cmake configure, Qt reports that all these system libraries have been found, including ICU. However in the final APK package, the ICU libraries are missing. Also the application fails to start in the Android device. When I check the Android logs, I can see the following error:

       02-28 18:56:31.891 22188 22221 I Qt JAVA : Can't find '/data/app/~~poajl3LcALVGBCcmRpVeow==/net.sixteenbpp.psraytracing-lRYB2FOoERameDoL9oj8jg==/lib/arm64/libicudata.so.so'
      02-28 18:56:31.891 22188 22221 I Qt JAVA : Can't find '/data/app/~~poajl3LcALVGBCcmRpVeow==/net.sixteenbpp.psraytracing-lRYB2FOoERameDoL9oj8jg==/lib/arm64/libicudata.so.so'
      02-28 18:56:31.891 22188 22221 I Qt JAVA : Can't find '/data/app/~~poajl3LcALVGBCcmRpVeow==/net.sixteenbpp.psraytracing-lRYB2FOoERameDoL9oj8jg==/lib/arm64/libicuuc.so.so'
      02-28 18:56:31.891 22188 22221 I Qt JAVA : Can't find '/data/app/~~poajl3LcALVGBCcmRpVeow==/net.sixteenbpp.psraytracing-lRYB2FOoERameDoL9oj8jg==/lib/arm64/libicui18n.so.so'
      02-28 18:56:31.893 22188 22221 E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
      02-28 18:56:31.893 22188 22221 E AndroidRuntime: Process: net.sixteenbpp.psraytracing, PID: 22188
      02-28 18:56:31.893 22188 22221 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libicui18n.so.70" not found: needed by /data/app/~~poajl3LcALVGBCcmRpVeow==/net.sixteenbpp.psraytracing-lRYB2FOoERameDoL9oj8jg==/lib/arm64/libQt6Core_arm64-v8a.so in namespace classloader-namespace
      02-28 18:56:31.893 22188 22221 E AndroidRuntime:  at java.lang.Runtime.load0(Runtime.java:929)
      02-28 18:56:31.893 22188 22221 E AndroidRuntime:  at java.lang.System.load(System.java:1620)
      02-28 18:56:31.893 22188 22221 E AndroidRuntime:  at org.qtproject.qt.android.QtNative$2.run(QtNative.java:459)
      02-28 18:56:31.893 22188 22221 E AndroidRuntime:  at org.qtproject.qt.android.QtThread$2.run(QtThread.java:87)
      02-28 18:56:31.893 22188 22221 E AndroidRuntime:  at org.qtproject.qt.android.QtThread$1.run(QtThread.java:61)
      02-28 18:56:31.893 22188 22221 E AndroidRuntime:  at java.lang.Thread.run(Thread.java:920)
      

      The "interesting" part seems to be the library names for ICU: For example "libicui18n.so.so" (with duplicate "so"-suffix).

      In my library installation directory, the ICU libraries have the "correct" names:

      lrwxrwxrwx   1 user user       18 Feb 26 09:20 libicudata.so -> libicudata.so.70.1
      lrwxrwxrwx   1 user user       18 Feb 26 09:20 libicudata.so.70 -> libicudata.so.70.1
      -rwxr-xr-x   1 user user 29467752 Feb 26 09:20 libicudata.so.70.1
      lrwxrwxrwx   1 user user       18 Feb 26 09:20 libicui18n.so -> libicui18n.so.70.1
      lrwxrwxrwx   1 user user       18 Feb 26 09:20 libicui18n.so.70 -> libicui18n.so.70.1
      -rwxr-xr-x   1 user user  4161144 Feb 26 09:20 libicui18n.so.70.1
      lrwxrwxrwx   1 user user       16 Feb 26 09:20 libicuio.so -> libicuio.so.70.1
      lrwxrwxrwx   1 user user       16 Feb 26 09:20 libicuio.so.70 -> libicuio.so.70.1
      -rwxr-xr-x   1 user user   106456 Feb 26 09:20 libicuio.so.70.1
      lrwxrwxrwx   1 user user       16 Feb 26 09:20 libicuuc.so -> libicuuc.so.70.1
      lrwxrwxrwx   1 user user       16 Feb 26 09:20 libicuuc.so.70 -> libicuuc.so.70.1
      -rwxr-xr-x   1 user user  2484304 Feb 26 09:20 libicuuc.so.70.1
      

      I can confirm that when I manually copy the above libraries into $ANDROID_PACKAGE_SOURCE_DIR/libs/ in the custom package directory with the incorrect names (like "libicui18n.so.so"), the application works.

      On the other hand, with the correct ICU library names (like "libicui18n.so"), the application fails to start.

      I assume the failing deployment with androiddeployqt is somehow related to the "incorrect" ICU library names?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            semlanik Alexey Edelev
            emmenlau Mario Emmenlauer
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes