diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle index de37b5ea6b..a104687f4e 100644 --- a/src/android/templates/build.gradle +++ b/src/android/templates/build.gradle @@ -14,7 +14,7 @@ repositories { mavenCentral() } -apply plugin: 'com.android.application' +apply plugin: qtGradlePluginType dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) @@ -29,6 +29,7 @@ android { * - qtAndroidDir - holds the path to qt android files * needed to build any Qt application * on Android. + * - qtGradlePluginType - whether to build an app or a library * * are defined in gradle.properties file. This file is * updated by QtCreator and androiddeployqt tools. diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 831b1361ce..cbe6336c97 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -2850,6 +2850,7 @@ bool buildAndroidProject(const Options &options) abiList.append(it.key()); } gradleProperties["qtTargetAbiList"] = abiList.toLocal8Bit();// armeabi-v7a or arm64-v8a or ... + gradleProperties["qtGradlePluginType"] = "com.android.application"; if (!mergeGradleProperties(gradlePropertiesPath, gradleProperties)) return false;