Qt6 Cmake Link Android Library
Solved
Mobile and Embedded
-
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
-
Sorry guys It's about fking gradle version it's solved!
-