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

Hardcoded Android NDK paths in Qt for Android from Qt installer.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 5.15
    • 5.13.0
    • Packaging & Installer
    • Android

    Description

      With current Qt 5.13.0 for Android + Qt Automotive extensions from installer I have problem building companion app for neptune3-ui.

      Current setup:

      1. Ubuntu 16.04 Mate
        Qt from installed installed in ${HOME}/QtQt/
        Android SDK and NDK installed in:
        ${HOME}/android-sdk-linux/ and ${HOME}/android-ndk-r19-beta2/ respectively.
        NDK worked with 5.12 branch.
      2. Set environments variables:
        ANDROID_HOME=${HOME}/android-sdk-linux/
        ANDROID_NDK_ROOT=${HOME}/android-ndk-r19-beta2
      3. Got latest neptune3-ui source and checked out 5.13 branch.
      4. Created build1 and install subdirectories in the source directory
      5. switched into build1
      6. ran:
      ~/QtQt/5.13.0/android_armv7/bin/qmake ../settings_app_android.pro -spec android-clang
      make qmake_all

      that part succeeded.

      1. ran:
        make -j $(nproc) 
        

        that failed with:

        rm -f libdrivedata_backend_qtro.so
        /home/nzamotaev/android-ndk-r19-beta2/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -D__ANDROID_API__=21 -target armv7-none-linux-androideabi -gcc-toolchain /home/nzamotaev/android-ndk-r19-beta2/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -Wl,--exclude-libs,libunwind.a --sysroot=/home/nzamotaev/android-ndk-r19-beta2/platforms/android-21/arch-arm/ -Wl,-rpath=\$ORIGIN/../lib -Wl,-rpath=/home/nzamotaev/QtQt/5.13.0/android_armv7/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -Wl,-soname,libdrivedata_backend_qtro.so -o libdrivedata_backend_qtro.so instrumentclusterbackend.o drivedataplugin.o moc_instrumentclusterbackend.o moc_drivedataplugin.o moc_rep_pagingmodel_replica.o moc_rep_instrumentcluster_replica.o  -L/home/nzamotaev/Projects/neptune3-ui/build1/lib -ldrivedata /home/nzamotaev/QtQt/5.13.0/android_armv7/lib/libQt5Gui.so -L/opt/android/android-ndk-r19c/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a /home/nzamotaev/QtQt/5.13.0/android_armv7/lib/libQt5IviRemoteObjectsHelper.a /opt/android/android-ndk-r19c/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++.so.21 -llog -lz -lm -ldl -lc /home/nzamotaev/QtQt/5.13.0/android_armv7/lib/libQt5IviCore.so /home/nzamotaev/QtQt/5.13.0/android_armv7/lib/libQt5Qml.so /home/nzamotaev/QtQt/5.13.0/android_armv7/lib/libQt5RemoteObjects.so /home/nzamotaev/QtQt/5.13.0/android_armv7/lib/libQt5Network.so /home/nzamotaev/QtQt/5.13.0/android_armv7/lib/libQt5Core.so -lGLESv2  -L/home/nzamotaev/android-ndk-r19-beta2/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a /home/nzamotaev/android-ndk-r19-beta2/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++.so.21 -llog -lz -lm -ldl -lc
        clang++: error: no such file or directory: '/opt/android/android-ndk-r19c/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++.so.21'
        Makefile:83: recipe for target '../../../plugins/qtivi/libdrivedata_backend_qtro.so' failed
        make[1]: *** [../../../plugins/qtivi/libdrivedata_backend_qtro.so] Error 1
        make[1]: Leaving directory '/home/nzamotaev/Projects/neptune3-ui/build1/src/drivedata/backend'
        Makefile:95: recipe for target 'sub-src-drivedata-backend-backend-pro-make_first-ordered' failed
        make: *** [sub-src-drivedata-backend-backend-pro-make_first-ordered] Error 2
        

        As seen in this log - it tries to link to a library in non-existent location /opt/android/android-ndk-r19c
        Making it a symlink to ${HOME}/android-ndk-r19-beta2 fixes this situation. But this is totally broken behavior.  Also - it worked before 5.13.

      This hardcode is everywhere:

      nzamotaev@nzamotaev0:~/QtQt/5.13.0/android_armv7$ pwd
      /home/nzamotaev/QtQt/5.13.0/android_armv7
      nzamotaev@nzamotaev0:~/QtQt/5.13.0/android_armv7$ grep "android-ndk-r19c" -R .|wc -l
      184

      If needed - I can give the list of files.
      But they are .prl and  .la

      Attachments

        1. image.png
          123 kB
          Nikolay Zamotaev

        Issue Links

          For Gerrit Dashboard: QTBUG-77296
          # Subject Branch Project Status CR V

          Activity

            People

              iknd Iikka Eklund
              n.z. Nikolay Zamotaev
              Votes:
              1 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes