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. Qt6 Cmake Link Android Library
QtWS25 Last Chance

Qt6 Cmake Link Android Library

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 444 Views
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    Hello, I am trying to migrate my Qt5 applications to Qt 6. For an existing application, I was able to link Android libraries in Qt 5 as follows. How can I do this using Cmake in Qt6?

    Qt5 Qmake

        OTHER_FILES +=  android/aaaLib
                       
    

    I couldn't do that in Qt6. This is the recipe I used for Cmake.

    if (ANDROID)
        set_target_properties(myapp PROPERTIES QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android)
        include(C:/Users/home/AppData/Local/Android/Sdk/android_openssl/CMakeLists.txt)
    endif ()
    

    This is the error I get when I want to compile my app.

    * What went wrong:
    Some problems were found with the configuration of task ':mergeDebugJniLibFolders' (type 'MergeSourceSetFolders').
      - Gradle detected a problem with the following location: 'C:\qtproc\build-my-app-Android_Qt_6_5_0_Clang_armeabi_v7a-Debug\android-build\libs'.
    
    Reason: Task ':mergeDebugJniLibFolders' uses this output of task ':libs:aaaLib:compileDebugAidl' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
        Possible solutions:
          1. Declare task ':libs:aaaLib:compileDebugAidl' as an input of ':mergeDebugJniLibFolders'.
          2. Declare an explicit dependency on ':libs:aaaLib:compileDebugAidl' from ':mergeDebugJniLibFolders' using Task#dependsOn.
          3. Declare an explicit dependency on ':libs:aaaLib:compileDebugAidl' from ':mergeDebugJniLibFolders' using Task#mustRunAfter.
        
        Please refer to https://docs.gradle.org/8.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.
      - Gradle detected a problem with the following location: 'C:\qtproc\build-my-app-Android_Qt_6_5_0_Clang_armeabi_v7a-Debug\android-build\libs'.
        
        
    

    How can you help me with this?

    Edit:

    I defined something like this but it didn't work for me.

    set_target_properties(cryptex-vpn PROPERTIES QT_ANDROID_EXTRA_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/android/libs)
    

    https://doc.qt.io/qt-6/cmake-target-property-qt-android-extra-libs.html

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Sorry guys It's about fking gradle version it's solved!

      1 Reply Last reply
      0
      • System has marked this topic as solved on

      • Login

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