QT generates gradle.properties
with the following values:
1 2 3 4 5 6 7 8 9 10 11 | android.useAndroidX=true android.enableJetifier=true androidBuildToolsVersion=34.0.0 androidCompileSdkVersion=34 androidNdkVersion=26.2.11394342 buildDir=build qt5AndroidDir=C:/dev/libs/Qt6/android/release/arm64-v8a/./src/android/java qtAndroidDir=C:/dev/libs/Qt6/android/release/arm64-v8a/./src/android/java qtMinSdkVersion=23 qtTargetAbiList=arm64-v8a qtTargetSdkVersion=33 |
that are used in my build.gradle
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | buildscript { // ext.kotlin_version = '1.8.0' //1.7.10 repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.4.1' //7.3.1 // classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") } } repositories { google() mavenCentral() // IronSource maven { url = uri("https://android-sdk.is.com/") } // Pangle maven { url = uri("https://artifact.bytedance.com/repository/pangle") } // Tapjoy maven { url = uri("https://sdk.tapjoy.com/") } // Mintegral maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") } // Chartboost maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") } // AppNext maven { url = uri("https://dl.appnext.com/") } } apply plugin: 'com.android.application' dependencies { // implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) //See the latest SDK version here: https://mvnrepository.com/artifact/com.yandex.android/mobileads-mediation implementation 'com.yandex.android:mobileads-mediation:7.1.0.0' // implementation 'com.yandex.android:mobileads:6.2.0' // implementation 'com.yandex.ads.mediation:mobileads-google:22.4.0.0' // implementation 'com.google.android.gms:play-services-ads:21.5.0' implementation "com.android.billingclient:billing:6.0.1" // From the template implementation 'androidx.core:core:1.10.1' //GDPR implementation("com.google.android.ump:user-messaging-platform:2.2.0") } android { /******************************************************* * The following variables: * - androidBuildToolsVersion, * - androidCompileSdkVersion * - qtAndroidDir - holds the path to qt android files * needed to build any Qt application * on Android. * * are defined in gradle.properties file. This file is * updated by QtCreator and androiddeployqt tools. * Changing them manually might break the compilation! *******************************************************/ //androiddeployqt.exe fails without package attribute in the mainifest. //namespace 'net.geographx.LinesGame' compileSdkVersion androidCompileSdkVersion.toInteger() buildToolsVersion androidBuildToolsVersion ndkVersion androidNdkVersion sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = [qtAndroidDir + '/src', 'src', 'yandex-ad-src', 'java'] aidl.srcDirs = [qtAndroidDir + '/src', 'src', 'aidl'] res.srcDirs = [qtAndroidDir + '/res', 'res'] resources.srcDirs = ['resources'] renderscript.srcDirs = ['src'] assets.srcDirs = ['assets'] jniLibs.srcDirs = ['libs'] } } tasks.withType(JavaCompile) { options.incremental = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } // From the template // Extract native libraries from the APK packagingOptions.jniLibs.useLegacyPackaging true lintOptions { abortOnError false } // Do not compress Qt binary resources file aaptOptions { noCompress 'rcc' } defaultConfig { minSdkVersion qtMinSdkVersion targetSdkVersion qtTargetSdkVersion ndk.abiFilters = qtTargetAbiList.split(",") //For debug builds native-debug-symbols.zip size is 432MB. //Use SYMBOL_TABLE to upload debug builds. ndk.debugSymbolLevel "FULL" } //The build type becomes release when we sign the bundle, //otherwize the build type is debug with both Debug and RelWithDebInfo. //With SYMBOL_TABLE we have .sym in native-debug-symbols.zip and //with FULL we have .dbg. /* buildTypes { release { //Full debug for uploading production and beta builds. ndk.debugSymbolLevel "FULL" } debug { //Small debug info for uploading internal testing builds. ndk.debugSymbolLevel "SYMBOL_TABLE" } } */ } |
Build output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | 23:48:48: Running steps for project LinesGameQt... 23:48:48: Starting: "C:\dev\tools\cmake-3.24.2-windows-x86_64\bin\cmake.exe" --build C:/dev/repos/examples/src/LinesGame/build-LinesGameQt-Android_Qt_6_6_2_arm64_v8a_Release_Clang_arm64_v8a-Release --target all [1/1 2.5/sec] Copying LinesGameQt binary to apk folder 23:48:49: The process "C:\dev\tools\cmake-3.24.2-windows-x86_64\bin\cmake.exe" exited normally. 23:48:49: Starting: "C:\dev\libs\Qt6\windows\bin\androiddeployqt.exe" --input C:/dev/repos/examples/src/LinesGame/build-LinesGameQt-Android_Qt_6_6_2_arm64_v8a_Release_Clang_arm64_v8a-Release/android-LinesGameQt-deployment-settings.json --output C:/dev/repos/examples/src/LinesGame/build-LinesGameQt-Android_Qt_6_6_2_arm64_v8a_Release_Clang_arm64_v8a-Release/android-build --android-platform android-34 --jdk "C:/Program Files/Android/Android Studio/jbr" --gradle --aab --jarsigner --release --sign ****** --storepass ****** Using package signing store password found from the environment variable. Using package signing key password found from the environment variable. Generating Android Package Input file: C:/dev/repos/examples/src/LinesGame/build-LinesGameQt-Android_Qt_6_6_2_arm64_v8a_Release_Clang_arm64_v8a-Release/android-LinesGameQt-deployment-settings.json Output directory: C:/dev/repos/examples/src/LinesGame/build-LinesGameQt-Android_Qt_6_6_2_arm64_v8a_Release_Clang_arm64_v8a-Release/android-build/ Application binary: LinesGameQt Android build platform: android-34 Install to device: No 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 Starting a Gradle Daemon, 3 busy and 1 incompatible and 2 stopped Daemons could not be reused, use --status for details WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34 This Android Gradle plugin (7.4.1) was tested up to compileSdk = 33 This warning can be suppressed by adding android.suppressUnsupportedCompileSdk=34 to this project's gradle.properties The build will continue, but you are strongly encouraged to update your project to use a newer Android Gradle Plugin that has been tested with compileSdk = 34 > Task :preBuild UP-TO-DATE > Task :preReleaseBuild UP-TO-DATE > Task :compileReleaseAidl NO-SOURCE > Task :compileReleaseRenderscript The RenderScript APIs are deprecated. They will be removed in Android Gradle plugin 9.0. See the following link for a guide to migrate from RenderScript: https://developer.android.com/guide/topics/renderscript/migrate > Task :generateReleaseBuildConfig > Task :javaPreCompileRelease > Task :checkReleaseAarMetadata WARNING: [Processor] Library 'C:\Users\dmitr\.gradle\caches\modules-2\files-2.1\com.my.target\mytarget-sdk\5.20.1\564a452abda77b561e6249e6fda53b165913b2cf\mytarget-sdk-5.20.1.aar' contains references to both AndroidX and old support library. This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway. Example of androidX reference: 'androidx/annotation/Nullable' Example of support library reference: 'android/support/annotation/VisibleForTesting' WARNING: [Processor] Library 'C:\Users\dmitr\.gradle\caches\modules-2\files-2.1\com.bigossp\bigo-ads\4.7.4\16e4034ded03cd38c86dcebe007a58abe089038e\bigo-ads-4.7.4.aar' contains references to both AndroidX and old support library. This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway. Example of androidX reference: 'androidx/annotation/NonNull' Example of support library reference: 'android/support/annotation/NonNull' > Task :generateReleaseResValues > Task :mapReleaseSourceSetPaths > Task :generateReleaseResources > Task :createReleaseCompatibleScreenManifests > Task :extractDeepLinksRelease > Task :mergeReleaseResources > Task :processReleaseMainManifest package="net.geographx.LinesGame" found in source AndroidManifest.xml: C:\dev\repos\examples\src\LinesGame\build-LinesGameQt-Android_Qt_6_6_2_arm64_v8a_Release_Clang_arm64_v8a-Release\android-build\AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. > Task :processReleaseManifest > Task :extractProguardFiles > Task :mergeReleaseJniLibFolders > Task :checkReleaseDuplicateClasses > Task :mergeReleaseShaders > Task :compileReleaseShaders NO-SOURCE > Task :generateReleaseAssets UP-TO-DATE > Task :mergeReleaseArtProfile > Task :mergeReleaseAssets > Task :processReleaseJavaRes NO-SOURCE > Task :compressReleaseAssets > Task :collectReleaseDependencies > Task :sdkReleaseDependencyData > Task :writeReleaseAppMetadata > Task :writeReleaseSigningConfigVersions > Task :preDebugBuild UP-TO-DATE > Task :compileDebugRenderscript The RenderScript APIs are deprecated. They will be removed in Android Gradle plugin 9.0. See the following link for a guide to migrate from RenderScript: https://developer.android.com/guide/topics/renderscript/migrate > Task :generateDebugResValues > Task :mapDebugSourceSetPaths > Task :generateDebugResources > Task :mergeReleaseJavaResource > Task :mergeReleaseNativeLibs > Task :createDebugCompatibleScreenManifests > Task :extractDeepLinksDebug > Task :mergeDebugResources > Task :processDebugMainManifest package="net.geographx.LinesGame" found in source AndroidManifest.xml: C:\dev\repos\examples\src\LinesGame\build-LinesGameQt-Android_Qt_6_6_2_arm64_v8a_Release_Clang_arm64_v8a-Release\android-build\AndroidManifest.xml. Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated. Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information. > Task :processDebugManifest > Task :processApplicationManifestDebugForBundle > Task :desugarReleaseFileDependencies > Task :stripReleaseDebugSymbols Unable to strip the following libraries, packaging them as they are: libEncryptorP.so. > Task :mergeExtDexRelease ERROR:D8: com.android.tools.r8.kotlin.H > Task :processReleaseManifestForPackage warn: removing resource net.geographx.LinesGame:string/tt_request_permission_descript_external_storage without required default value. warn: removing resource net.geographx.LinesGame:string/tt_request_permission_descript_location without required default value. warn: removing resource net.geographx.LinesGame:string/tt_request_permission_descript_read_phone_state without required default value. > Task :bundleDebugResources > Task :extractReleaseNativeDebugMetadata > Task :mergeExtDexRelease WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\88b10649a5976d39fd28df9e30396d05\transformed\jetified-mbnative-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\88b10649a5976d39fd28df9e30396d05\transformed\jetified-mbnative-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\88b10649a5976d39fd28df9e30396d05\transformed\jetified-mbnative-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\88b10649a5976d39fd28df9e30396d05\transformed\jetified-mbnative-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\88b10649a5976d39fd28df9e30396d05\transformed\jetified-mbnative-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. ERROR:D8: com.android.tools.r8.kotlin.H ERROR:D8: com.android.tools.r8.kotlin.H WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\88b10649a5976d39fd28df9e30396d05\transformed\jetified-mbnative-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\88b10649a5976d39fd28df9e30396d05\transformed\jetified-mbnative-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\88b10649a5976d39fd28df9e30396d05\transformed\jetified-mbnative-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. ... WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\b0c0977f122547457bc39e9ab5a29562\transformed\jetified-same-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\b0c0977f122547457bc39e9ab5a29562\transformed\jetified-same-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\b0c0977f122547457bc39e9ab5a29562\transformed\jetified-same-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\b0c0977f122547457bc39e9ab5a29562\transformed\jetified-same-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\b0c0977f122547457bc39e9ab5a29562\transformed\jetified-same-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\b0c0977f122547457bc39e9ab5a29562\transformed\jetified-same-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\b0c0977f122547457bc39e9ab5a29562\transformed\jetified-same-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\b0c0977f122547457bc39e9ab5a29562\transformed\jetified-same-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\b0c0977f122547457bc39e9ab5a29562\transformed\jetified-same-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. WARNING:C:\Users\dmitr\.gradle\caches\transforms-3\b0c0977f122547457bc39e9ab5a29562\transformed\jetified-same-16.7.41-runtime.jar: D8: Expected stack map table for method with non-linear control flow. > Task :mergeExtDexRelease FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':mergeExtDexRelease'. > Could not resolve all files for configuration ':releaseRuntimeClasspath'. > Failed to transform inapp-sdk-5.0.0.aar (com.startapp:inapp-sdk:5.0.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=false, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}. > Execution failed for DexingWithClasspathTransform: C:\Users\dmitr\.gradle\caches\transforms-3\ece0a1adac493ae325ccdc059c741b3b\transformed\jetified-inapp-sdk-5.0.0-runtime.jar. > Error while dexing. > Failed to transform koin-core-jvm-3.5.3.jar (io.insert-koin:koin-core-jvm:3.5.3) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=false, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}. > Execution failed for DexingWithClasspathTransform: C:\Users\dmitr\.gradle\caches\transforms-3\219bf1980b2ba19908a72a999814b29b\transformed\jetified-koin-core-jvm-3.5.3.jar. > Error while dexing. > Failed to transform koin-annotations-jvm-1.3.0.jar (io.insert-koin:koin-annotations-jvm:1.3.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=false, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}. > Execution failed for DexingWithClasspathTransform: C:\Users\dmitr\.gradle\caches\transforms-3\cc5ef56c144f5f058ee587558b98641d\transformed\jetified-koin-annotations-jvm-1.3.0.jar. > Error while dexing. > Failed to transform kotlin-stdlib-1.9.22.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.22) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=false, dexing-min-sdk=23, org.gradle.category=library, org.gradle.jvm.environment=standard-jvm, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}. > Execution failed for DexingWithClasspathTransform: C:\Users\dmitr\.gradle\caches\transforms-3\c1da9daaba1aa2ef5cd1c64da66cfa21\transformed\jetified-kotlin-stdlib-1.9.22.jar. > Error while dexing. * 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 1m 17s Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. 39 actionable tasks: 39 executed Building the android package failed! -- For more information, run this command with --verbose. 23:50:10: The process "C:\dev\libs\Qt6\windows\bin\androiddeployqt.exe" exited with code 14. Error while building/deploying project LinesGameQt (kit: Android Qt 6.6.2 (arm64-v8a) Release Clang arm64-v8a) When executing step "Build Android APK" 23:50:10: Elapsed time: 01:22. |
My working version of build.gradle
with Yandex SDK 6.4.1.0
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | buildscript { ext.kotlin_version = '1.8.0' //1.7.10 repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.4.1' //7.3.1 classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") } } repositories { google() mavenCentral() // IronSource maven { url = uri("https://android-sdk.is.com/") } // Pangle maven { url = uri("https://artifact.bytedance.com/repository/pangle") } // Tapjoy maven { url = uri("https://sdk.tapjoy.com/") } // Mintegral maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") } // Chartboost maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") } // AppNext maven { url = uri("https://dl.appnext.com/") } } apply plugin: 'com.android.application' dependencies { // implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) //See the latest SDK version here: https://mvnrepository.com/artifact/com.yandex.android/mobileads-mediation implementation 'com.yandex.android:mobileads-mediation:6.4.1.0' // implementation 'com.yandex.android:mobileads:6.2.0' // implementation 'com.yandex.ads.mediation:mobileads-google:22.4.0.0' // implementation 'com.google.android.gms:play-services-ads:21.5.0' implementation "com.android.billingclient:billing:6.0.1" // From the template implementation 'androidx.core:core:1.10.1' //GDPR implementation("com.google.android.ump:user-messaging-platform:2.2.0") } android { /******************************************************* * The following variables: * - androidBuildToolsVersion, * - androidCompileSdkVersion * - qtAndroidDir - holds the path to qt android files * needed to build any Qt application * on Android. * * are defined in gradle.properties file. This file is * updated by QtCreator and androiddeployqt tools. * Changing them manually might break the compilation! *******************************************************/ //androiddeployqt.exe fails without package attribute in the mainifest. //namespace 'net.geographx.LinesGame' compileSdkVersion androidCompileSdkVersion.toInteger() buildToolsVersion androidBuildToolsVersion ndkVersion androidNdkVersion sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = [qtAndroidDir + '/src', 'src', 'yandex-ad-src', 'java'] aidl.srcDirs = [qtAndroidDir + '/src', 'src', 'aidl'] res.srcDirs = [qtAndroidDir + '/res', 'res'] resources.srcDirs = ['resources'] renderscript.srcDirs = ['src'] assets.srcDirs = ['assets'] jniLibs.srcDirs = ['libs'] } } tasks.withType(JavaCompile) { options.incremental = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } // From the template // Extract native libraries from the APK packagingOptions.jniLibs.useLegacyPackaging true lintOptions { abortOnError false } // Do not compress Qt binary resources file aaptOptions { noCompress 'rcc' } defaultConfig { minSdkVersion qtMinSdkVersion targetSdkVersion qtTargetSdkVersion ndk.abiFilters = qtTargetAbiList.split(",") //For debug builds native-debug-symbols.zip size is 432MB. //Use SYMBOL_TABLE to upload debug builds. ndk.debugSymbolLevel "FULL" } //The build type becomes release when we sign the bundle, //otherwize the build type is debug with both Debug and RelWithDebInfo. //With SYMBOL_TABLE we have .sym in native-debug-symbols.zip and //with FULL we have .dbg. /* buildTypes { release { //Full debug for uploading production and beta builds. ndk.debugSymbolLevel "FULL" } debug { //Small debug info for uploading internal testing builds. ndk.debugSymbolLevel "SYMBOL_TABLE" } } */ } |
Android Studio uses the following AGP version:

Finally I built my app with Yandex Ad SDK 7.2 with the following build.gradle
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | buildscript { repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:8.3.0' //Original QT version was 7.4.1 classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22") } } repositories { google() mavenCentral() // IronSource maven { url = uri("https://android-sdk.is.com/") } // Pangle maven { url = uri("https://artifact.bytedance.com/repository/pangle") } // Tapjoy maven { url = uri("https://sdk.tapjoy.com/") } // Mintegral maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") } // Chartboost maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") } // AppNext maven { url = uri("https://dl.appnext.com/") } } apply plugin: 'com.android.application' dependencies { // implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) //See the latest SDK version here: https://mvnrepository.com/artifact/com.yandex.android/mobileads-mediation implementation 'com.yandex.android:mobileads-mediation:7.2.0.0' // implementation 'com.yandex.android:mobileads:6.2.0' // implementation 'com.yandex.ads.mediation:mobileads-google:22.4.0.0' // implementation 'com.google.android.gms:play-services-ads:21.5.0' implementation "com.android.billingclient:billing:7.0.0" // From the template implementation 'androidx.core:core:1.10.1' //GDPR implementation("com.google.android.ump:user-messaging-platform:2.2.0") } android { /******************************************************* * The following variables: * - androidBuildToolsVersion, * - androidCompileSdkVersion * - qtAndroidDir - holds the path to qt android files * needed to build any Qt application * on Android. * * are defined in gradle.properties file. This file is * updated by QtCreator and androiddeployqt tools. * Changing them manually might break the compilation! *******************************************************/ compileSdkVersion androidCompileSdkVersion.toInteger() buildToolsVersion androidBuildToolsVersion ndkVersion androidNdkVersion // Added while upgrading Gradle plugin to 8.3. // But androiddeployqt.exe still fails without package attribute in the mainifest. namespace = "net.geographx.LinesGame" // Tried to copy this just in case from Yandex Ad sample, but it does not compile. // The error is "Could not find method kotlinOptions() on extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension." // kotlinOptions { // jvmTarget = "1.8" // } sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = [qtAndroidDir + '/src', 'src', 'yandex-ad-src', 'java'] aidl.srcDirs = [qtAndroidDir + '/src', 'src', 'aidl'] res.srcDirs = [qtAndroidDir + '/res', 'res'] resources.srcDirs = ['resources'] renderscript.srcDirs = ['src'] assets.srcDirs = ['assets'] jniLibs.srcDirs = ['libs'] } } tasks.withType(JavaCompile) { options.incremental = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } // From the template // Extract native libraries from the APK packagingOptions.jniLibs.useLegacyPackaging true lintOptions { abortOnError false } // Do not compress Qt binary resources file aaptOptions { noCompress 'rcc' } defaultConfig { minSdkVersion qtMinSdkVersion targetSdkVersion qtTargetSdkVersion ndk.abiFilters = qtTargetAbiList.split(",") //For debug builds native-debug-symbols.zip size is 432MB. //Use SYMBOL_TABLE to upload debug builds. ndk.debugSymbolLevel "FULL" } //The build type becomes release when we sign the bundle, //otherwize the build type is debug with both Debug and RelWithDebInfo. //With SYMBOL_TABLE we have .sym in native-debug-symbols.zip and //with FULL we have .dbg. /* buildTypes { release { //Full debug for uploading production and beta builds. ndk.debugSymbolLevel "FULL" } debug { //Small debug info for uploading internal testing builds. ndk.debugSymbolLevel "SYMBOL_TABLE" } } */ } |
Also I replaced 8.3
with 8.4
in my gradle\wrapper\gradle-wrapper.properties
:
1 2 3 4 5 6 7 | distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists |
After that the application size increased from 45MB to 81MB.
Also Yandex Ad SDK 7.2 request some new features:

so some devices are not longer supported:

Kotlin Versions:
https://kotlinlang.org/docs/gradle-configure-project.html#apply-the-plugin
Integrating Yandex mediation
https://ads.yandex.com/helpcenter/en/dev/android/quick-start-mm
This Android Gradle plugin (7.4.1) was tested up to compileSdk = 33
https://stackoverflow.com/questions/77402950/flutter-android-application-stopped-to-build-after-last-flutter-update
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
https://developer.android.com/build/releases/gradle-plugin
gradle wrapper –gradle-version 8.5
distributionUrl = https\://services.gradle.org/distributions/gradle-8.5-bin.zip
Docs: https://github.com/yandexmobile/yandex-ads-sdk-android?tab=readme-ov-file
Example: https://github.com/yandexmobile/yandex-ads-sdk-android/tree/master/YandexMobileAdsExample
gradle-wrapper goes from qt-everywhere-src-6.7.2\qtbase\src\3rdparty\gradle, build.gradle goes from qt-everywhere-src-6.7.2\qtbase\src\android\templates\build.gradle
Gradle 8.3 requires namespace: developer.android.com/build/configure-app-module#set-namespace
Gradle wrapper, version 8.3 doc.qt.io/qt-6/qtcore-attribution-android-gradle-wrapper.html