Version Compatibility
-
I've been unable to get the versions of all my dependencies correct for a long time
Target System - Tablet
oftware: Oukitel WP32 Pro
Model: Oukitel RT3
Android 12
spec pageCurrent Version Requirements I Understand
Android OS 12
Android API 32gradle --version Gradle 8.3 ------------------------------------------------------------ Build time: 2023-08-17 07:06:47 UTC Revision: 8afbf24b469158b714b36e84c6f4d4976c86fcd5 Kotlin: 1.9.0 Groovy: 3.0.17 Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023 JVM: 17.0.12 (Ubuntu 17.0.12+7-Ubuntu-1ubuntu224.04) OS: Linux 6.8.0-45-generic amd64
JDK 17
NDK 26.1.10909125
Qt Creator 14.0.1
Qt 6.7.2
emsdk 3.1.50
based on this link for android api table and this one for android qt dependancies and this one for emsdk version
In QT creator > SDK Manager
Qt Creator > Projects (left panel) > Build & Run (second from left panel) > Android Qt 6.7 Clang arm64-v8a > Build > Build Settings (right panel) >
(Note: everytime I look away and look back the Android build-tools version keeps changing automatically and I keep changing it back)
Android Device
Problem
The below is the output, and shows how many things about my configuration are incorrect despite following all these compatibility tables.
I run Build with the device selected on Debug with kit Android Qt 6.7 Clang arm64-v8a
Compile Output12:53:42: Running steps for project syghtguiApp... 12:53:42: Starting: "/home/sage/Qt/Tools/CMake/bin/cmake" --build /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug --target all [1/10 24.4/sec] Automatic MOC and UIC for target syghtguiApp [2/9 45.5/sec] Running AUTOMOC file extraction for target syghtguiApp [3/3 46.9/sec] Copying syghtguiApp binary to apk folder 12:53:42: The process "/home/sage/Qt/Tools/CMake/bin/cmake" exited normally. 12:53:42: Starting: "/home/sage/Qt/6.7.2/gcc_64/bin/androiddeployqt" --input /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-syghtguiApp-deployment-settings.json --output /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build --android-platform android-32 --jdk /usr/lib/jvm/java-1.17.0-openjdk-amd64 --gradle Generating Android Package Input file: /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-syghtguiApp-deployment-settings.json Output directory: /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build/ Application binary: syghtguiApp Android build platform: android-32 Install to device: No Warning: QML import could not be resolved in any of the import paths: QML Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Windows Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.macOS Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.iOS Warning: QML import could not be resolved in any of the import paths: TransitionItem Warning: QML import could not be resolved in any of the import paths: Qt5Compat.GraphicalEffects Warning: QML import could not be resolved in any of the import paths: QtQuickUltralite.Extras Warning: QML import could not be resolved in any of the import paths: EventList > Task :preBuild UP-TO-DATE > Task :preDebugBuild UP-TO-DATE > Task :mergeDebugNativeDebugMetadata NO-SOURCE > Task :compileDebugAidl NO-SOURCE > Task :compileDebugRenderscript NO-SOURCE > Task :generateDebugBuildConfig UP-TO-DATE > Task :javaPreCompileDebug UP-TO-DATE > Task :generateDebugResValues UP-TO-DATE > Task :checkDebugAarMetadata FAILED > Task :mapDebugSourceSetPaths UP-TO-DATE FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':checkDebugAarMetadata'. > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction > 5 issues were found when checking AAR metadata: 1. Dependency 'androidx.core:core:1.13.1' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. : is currently compiled against android-32. Also, the maximum recommended compile SDK version for Android Gradle plugin 7.4.1 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdkVerion of at least 34. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 2. Dependency 'androidx.lifecycle:lifecycle-runtime:2.6.2' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. : is currently compiled against android-32. 5 actionable tasks: 1 executed, 4 up-to-date Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 3. Dependency 'androidx.arch.core:core-runtime:2.2.0' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. : is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 4. Dependency 'androidx.profileinstaller:profileinstaller:1.3.0' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. : is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 5. Dependency 'androidx.annotation:annotation-experimental:1.4.0' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. : is currently compiled against android-32. Also, the maximum recommended compile SDK version for Android Gradle plugin 7.4.1 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdkVerion of at least 34. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 1s Building the android package failed! -- For more information, run this command with --verbose. 12:53:45: The process "/home/sage/Qt/6.7.2/gcc_64/bin/androiddeployqt" exited with code 14. Error while building/deploying project syghtguiApp (kit: Android Qt 6.7.2 Clang arm64-v8a) When executing step "Build Android APK" 12:53:45: Elapsed time: 00:03.
-
This is what it is with Android... The problem might be in build tools version, see that and others in
https://wiki.qt.io/Qt_6.7_Tools_and_Versions#windows_10_22H2_x86_64 -
Not a Solution Changes
I edited the build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build/build.gradle file to 8.3 since thats what the qt docs say
dependencies { classpath 'com.android.tools.build:gradle:8.3.2' }
and the file
build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build/gradle/wrapper/gradle-wrapper.propertiesistributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
Build Output
Generating Android Package Input file: /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-syghtguiApp-deployment-settings.json Output directory: /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build/ Application binary: syghtguiApp Android build platform: android-32 Install to device: No Warning: QML import could not be resolved in any of the import paths: QML Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Windows Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.macOS Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.iOS Warning: QML import could not be resolved in any of the import paths: TransitionItem Warning: QML import could not be resolved in any of the import paths: Qt5Compat.GraphicalEffects Warning: QML import could not be resolved in any of the import paths: QtQuickUltralite.Extras Warning: QML import could not be resolved in any of the import paths: EventList FAILURE: Build failed with an exception. * Where: Build file '/home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build/build.gradle' line: 17 * What went wrong: A problem occurred evaluating root project 'android-build'. > Failed to apply plugin 'com.android.internal.version-check'. > Minimum supported Gradle version is 8.4. Current version is 8.3. If using the gradle wrapper, try editing the distributionUrl in /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build/gradle/wrapper/gradle-wrapper.properties to gradle-8.4-all.zip * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 20s Building the android package failed! -- For more information, run this command with --verbose. 16:20:49: The process "/home/sage/Qt/6.7.2/gcc_64/bin/androiddeployqt" exited with code 14. Error while building/deploying project syghtguiApp (kit: Android Qt 6.7.2 Clang arm64-v8a) When executing step "Build Android APK"
-
Unsuccessful Version Combination 3
Versions
JDK 17
NDK 26.1.10909125
Qt Creator 14.0.1
Qt 6.7.2
emsdk 3.1.50Qt Creator > Projects (left panel) > Build & Run (second from left panel) > Android Qt 6.7 Clang arm64-v8a > Build > Build Settings (right panel)
ANDROID_PLATFORM = android-23
Build Steps > Build Android APK > Android build tools version = 35
Build Steps > Build Android APK > Android build platform sdk = android-34
Qt Creator > Edit > Preferences > Devices > Type Specific
Cpu architecture = arm64-v8a
Os version = android 12L ("Sv2") (SDK 32)
Android target flavor = default android system image
SD card size = 512 Mb
Skin type = none
Open GL status = yesvim /gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build/build.gradle dependencies { classpath 'com.android.tools.build:gradle:8.3.2' }
gradle --version Gradle 8.3
vim build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build/gradle/wrapper/gradle-wrapper.properties istributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
Build Output
12:38:24: The process "/home/sage/Qt/Tools/CMake/bin/cmake" exited normally. 12:38:24: Starting: "/home/sage/Qt/6.7.2/gcc_64/bin/androiddeployqt" --input /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-syghtguiApp-deployment-settings.json --output /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build --android-platform android-34 --jdk /usr/lib/jvm/java-1.17.0-openjdk-amd64 --gradle Generating Android Package Input file: /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-syghtguiApp-deployment-settings.json Output directory: /home/sage/gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build/ Application binary: syghtguiApp Android build platform: android-34 Install to device: No Warning: QML import could not be resolved in any of the import paths: QML Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Windows Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.macOS Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.iOS Warning: QML import could not be resolved in any of the import paths: TransitionItem Warning: QML import could not be resolved in any of the import paths: Qt5Compat.GraphicalEffects Warning: QML import could not be resolved in any of the import paths: QtQuickUltralite.Extras Warning: QML import could not be resolved in any of the import paths: EventList Exception in thread "main" java.lang.RuntimeException: Could not create parent directory for lock file /opt/gradle/gradle-8.3/wrapper/dists/gradle-8.3-bin/dxjbbhstwasg8cbags9q7cvli/gradle-8.3-bin.zip.lck at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:43) at org.gradle.wrapper.Install.createDist(Install.java:68) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:102) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:66) Building the android package failed! -- For more information, run this command with --verbose. 12:38:26: The process "/home/sage/Qt/6.7.2/gcc_64/bin/androiddeployqt" exited with code 14. Error while building/deploying project syghtguiApp (kit: Android Qt 6.7.2 Clang arm64-v8a) When executing step "Build Android APK"
-
This is what it is with Android... The problem might be in build tools version, see that and others in
https://wiki.qt.io/Qt_6.7_Tools_and_Versions#windows_10_22H2_x86_64 -
Thanks @mvuori ! That looks really helpful! I'm going to save that link for my own instructions.
I haven't had a chance to put it on the tablet yet, but I now can build an apk!
I deleted and re-created my build directory in my project and increased permissions on my gradle dir
chmod a+rw /opt/gradle
I'm still getting all the warnings I was before though
Warning: QML import could not be resolved in any of the import paths
Software Versions
JDK 17
NDK 26.1.10909125
Qt Creator 14.0.1
Qt 6.7.2
emsdk 3.1.50Qt Creator > Projects (left panel) > Build & Run (second from left panel) > Android Qt 6.7 Clang arm64-v8a > Build > Build Settings (right panel)
ANDROID_PLATFORM = android-23
Build Steps > Build Android APK > Android build tools version = 35
Build Steps > Build Android APK > Android build platform sdk = android-34
Qt Creator > Edit > Preferences > Devices > Type Specific
Cpu architecture = arm64-v8a
Os version = android 12L ("Sv2") (SDK 32)
Android target flavor = default android system image
SD card size = 512 Mb
Skin type = none
Open GL status = yesvim /gui/syghtgui/build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build/build.gradle dependencies { classpath 'com.android.tools.build:gradle:7.4.1' }
gradle --version Gradle 8.3
vim build/Android_Qt_6_7_2_Clang_arm64_v8a-Debug/android-build/gradle/wrapper/gradle-wrapper.properties istributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
-
app is now compiled in debug mode and deployed to tablet. compiling in release mode isn't working.
-