summaryrefslogtreecommitdiffstats
path: root/src/android/templates/build.gradle
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Bump androix dependency to 1.12.0"Assam Boudjelthia2024-01-081-1/+1
| | | | | | | | | | | | | | This reverts commit 3bae65e7d61f85d2942c89e46e913c1056ba2daa. Reason for revert: This version requires API >= 34 but we have AGP 7.4.1 which was tested against API 33 max, and updating it to version 8.x is blocked by QTBUG-106907. So, this will be re-stated AGP update is done. Task-number: QTBUG-106907 Pick-to: 6.7 Change-Id: I1551ace76392a0532e1ecf431d03afbbd9d4a300 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Bump androix dependency to 1.12.0André Klitzing2023-11-131-1/+1
| | | | | | | | | This avoids linter warning like in 5dc9692e48ea15ab3da4283997547a2849f1944e: Obsolete Gradle Dependency Pick-to: 6.6 Change-Id: I5850af3206f3eaf80850918a13705c59ac3fb4ea Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Bump androidx dependency to 1.10.1André Klitzing2023-08-301-1/+1
| | | | | | | | | This avoids linter warning: Obsolete Gradle Dependency Pick-to: 6.6 6.5 Change-Id: I9d2e3f7a4d082c7b90e5e533b9fe3d5046b79a48 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: allow using string based versions in compileSdkVersionAssam Boudjelthia2023-04-051-1/+1
| | | | | | | | | | | | | | | | Some platform sdk packages have names that contains non-integer characters such as android-33-ext5 or android-UpsideDownCake which fail building with androiddeployqt because build.gradle expects an integer only. This allows using string based versions and also fallbacks to setting an integer only value if it finds that the build.gradle of the project is still explicitly converting to integer (this to avoid breaking existing projects). Fixes: QTBUG-112465 Pick-to: 6.5 6.2 5.15 Change-Id: If8cfc0fb84f0880a43644dc0a4188671736d3e21 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Android: use FileProvider with QDesktopServices::openUrl()Assam Boudjelthia2023-02-241-0/+1
| | | | | | | | | | | | | | | | | Allow openUrl() to use FileProvider for opening files that are located under app scoped paths and that use a file scheme for Android sdk 24 or above. [ChangeLog][Core][Android] Add FileProvider support for QDesktopServices::openUrl(). [ChangeLog][Core][Android] Add AndroidX dependency to Gradle builds by default since it's required by FileProvider. Fixes: QTBUG-85238 Change-Id: Ia7403f74f2a8fd4886f74dba72e42b318ef5d079 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Update Gradle to 8.0 and Android Gradle Plug-in (AGP) to 7.4.1Rami Potinkara2023-02-151-1/+1
| | | | | | | | | | | Gradle 8.0 and AGP 7.4.1 are the latest versions at Feb 2023. Fixes: QTBUG-110875 Pick-to: 6.5 Change-Id: Ia13b9e7859a873d2aade8782c279266d0982da21 Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Update Gradle to 7.5.1 and Android Gradle Plug-in (AGP) to 7.3.1Rami Potinkara2022-11-251-1/+1
| | | | | | | | | Gradle 7.5.1 and AGP 7.3.1 versions are the latest at the moment. Fixes: QTBUG-105510 Change-Id: Ie2229e8929a82d60836a5fe7b3a879459995f63e Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Update Gradle to 7.4.2 and Android Gradle Plug-in (AGP) to 7.2.1Rami Potinkara2022-07-061-1/+1
| | | | | | | | | Gradle 7.4.2 and AGP 7.2.1 versions are the latest at the moment. Fixes: QTBUG-103711 Pick-to: 6.4 Change-Id: I871d1331e0340e1cda7dbbc0799bb2c20aed6146 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: set useLegacyPackaging to true in build.gradleAssam Boudjelthia2022-04-261-0/+3
| | | | | | | | | | | | Since we set android:extractNativeLibs to "true" in AndroidManifest.xml, a warning is thrown by the gradle build, which needs the property packagingOptions.jniLibs.useLegacyPackaging to be set to true. Pick-to: 6.2 6.3 5.15 Change-Id: I725d2663d68ab88abfda630f8a61666510043967 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ramon Sadornil <ramon.sadornil@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Update Gradle to 7.2.0 and Android Gradle Plugin to 7.0.2Mårten Nordheim2021-10-221-1/+1
| | | | | | | | | | | | | | The latest build-tools 31.0.0 requires AGP version 7.0+, and that requires Gradle version 7.0+, so use the latest stable release for both. [1] https://developer.android.com/studio/releases/gradle-plugin? buildsystem=ndk-build#updating-gradle Fixes: QTBUG-97002 Pick-to: 6.2 Change-Id: I8ff26819bdf1a00f484ecc194c4d4e7bca2b598a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Android: replace ndk.dir with android.ndkVersion in build.gradleAssam Boudjelthia2021-10-131-1/+1
| | | | | | | | | | | | The use of ndk.dir in local.properties is deprecated in favor of android.ndkVersion in build.gradle, and will be totatlly removed in the future, so we need to adapt to that. Fixes: QTBUG-91391 Pick-to: 6.2 Change-Id: I54c57113a759d43c3685c9cdf2b9dcc5c948c0fd Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
* Android: use gradle repo mavenCentral() instead of jcenter()Assam Boudjelthia2021-10-061-2/+2
| | | | | | | | | | | jcenter() is deprecated and will be shutdown by next year [1], thus the replacement mavenCentral() could be used instead. [1] https://blog.gradle.org/jcenter-shutdown Pick-to: 6.2 Change-Id: Ic9d1c15d657f23712ee4c866d5c1a45706353429 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Specify Android architecture in gradle filesAndreas Buhr2021-09-301-0/+1
| | | | | | | | | | | | | | | | | | | When building for armeabi-v7a, building and APK using "ninja foo_make_apk" works. Building it by calling "gradlew assembleDebug" works. Opening the "android-build" folder in Android Studio and clicking the "Build" button works. But clicking the "Run" or "Debug" button in Android Studio does not work when the attached phone is arm64-v8a. Then Android Studio automatically selects the v8 architecture which does not find the Qt libraries. This patch adds explicit ABI selection to the gradle configuration files. With explicit ABI selection, Android Studio does not try to outsmart you. Pick-to: 6.2 Fixes: QTBUG-96701 Task-number: QTBUG-87022 Change-Id: I4ad6356c38b7eca004c0e0dbbb357cab7de84c0f Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Rename variable to not reference Qt5Andreas Buhr2021-09-301-4/+4
| | | | | | | | | In the Android gradle files, the variable qt5AndroidDir refers to Qt5 and might confuse users. This patch renames to qtAndroidDir. Pick-to: 6.2 Change-Id: Ib18a3cd2c38646e4c6c0435dae9234f0f7887eb5 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Remove unnecessary = signs from build.gradleAssam Boudjelthia2021-06-021-2/+2
| | | | | Change-Id: Ic7090ec2003b20a809f8920bae28bc9b88733cb8 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Android: Bump gradle (plugin) versionsMike Achtelik2021-04-101-2/+2
| | | | | | | | | | | | | | | | | | | Android Gradle plugin 4.1.3 is compatible with the new <queries> declaration for package visibility on Android 11. If someone adds the <queries> element or starts relying on a library or SDK that supports targeting Android 11, they might encounter manifest merging errors when building the app. This is important since starting August 2021 the PlayStore requires new apps from targeting Android 11. So lets update to the newest Android Gradle plugin version. This also reverts 1e4dec12d5c0152d5c3eee3b612a0af4bf389a37 as AGP 4.1 requires at least buildToolsVersion 29.0.2. Change-Id: Id8ce5dadeb8a325dc9f901503946f325f3fd18a0 Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Android: allow Android app building to use java 8 featuresAssam Boudjelthia2020-09-261-0/+5
| | | | | | | | | | Enable Gradle builds to use Java 8 features like lambda expression by default. Task-number: QTBUG-86282 Pick-to: 5.15 Change-Id: Ib497b8a789690fcca6e13ea4995e5966331c6c0d Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Android: remove --no-daemon arg for GradleAssam Boudjelthia2020-09-171-0/+4
| | | | | | | | | | | | | | Allow Gradle builds to run using JVM daemon, this will improve the current build time noticeably for clean builds and hugely for incremental builds. This will bring the Gradle build to comparable speed with a normal Gradle build in Android Studio. Task-number: QTBUG-86674 Pick-to: 5.15 Change-Id: Icc4267223802e4c9350b48099236650c023f868d Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Android: Bump gradle (plugin) versionsBogDan Vatra2020-03-041-1/+7
| | | | | | | | | Move min & target sdk from AndroidManifest.xml to build.gradle Fixes: QTBUG-70817 Change-Id: Id9bb9825a3232587e0255b2d3d6f0273c5f9b66a Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Android: Do not extract QML assets dataBogDan Vatra2019-10-021-0/+5
| | | | | | | | | | | | | | Instead to extract the assets QML file, we create a .rcc bundle file which is register by android qpa plugin before the it invokes the main function. Thsi way we avoid extracting the QML files from assets as they can be accessed directly from resources. [ChangeLog][Android] Instead of bundling QML resources in assets and extracting them on first start, Qt now creates an .rcc file and register it before invoking the main function. Change-Id: Icb2fda79d82c5af102cc9a0276ff26bb0d1599e8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Say hello to Android multi arch build in one goBogDan Vatra2019-08-261-1/+1
| | | | | | | | | | | | | | Multi arch build in one go is need to support the new .aab packaging format. By default the users apps are built for all Android ABIs: arm64-v8a armeabi-v7a x86_64 x86 The user can pass ANDROID_ABIS to qmake to filter the ABIs during development, e.g. qmake ANDROID_ABIS="arm64-v8a armeabi-v7a" will build only for arm ABIs. [ChangeLog][Android] Android multi arch build in one go, needed to support the new .aab packaging format. Change-Id: I3a64caf9621c2a195863976a62a57cdf47e6e3b5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-011-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket_openssl.cpp src/platformsupport/vkconvenience/qvkconvenience.cpp Change-Id: I97ce6ed185f7fdad8102cc58d3cfec0119fd7bb4
| * Android: Stick with buildToolsVersion 28.0.3BogDan Vatra2019-06-281-1/+1
| | | | | | | | | | | | | | | | On Windows buildToolsVersion 29.0.0 have problems, therefore, it's better to use a version that we know it works on all platofrms. Change-Id: I25cdea4b8101bfe5f022025fcd7cc4cbf358fa03 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Android: Fix resources folderBogDan Vatra2019-05-291-1/+1
|/ | | | | | | | | | | | | | | | | | | | Resources are usually needed to add extra stuff to apk lib/<arch> which normally are stripped by gradle. Change-Id: Id96ce246fdc2a4606e39ecfb75d5b3294aad3c08 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Also integrate Android AAR librariesVolker Krause2019-01-051-1/+1
| | | | | | | | | | | | This works in the same way as JARs are currently provided by dependencies, and becomes necessary when needing e.g. the Android support/compat libs for implementing the Java side of a library. While this is not relevant (yet?) for Qt itself, we hit this with KDE's notification framework. Change-Id: Ia87d1a048a493f7bc311abf5761f33d1943cfbe9 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Android: Fix build.gradleBogDan Vatra2018-11-051-1/+1
| | | | | | | | | | | Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html Task-number: QTBUG-71570 Change-Id: I6f498d8cb3ff01ad641aee697496e3dc56059a72 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Android: bump android gradle plugin versionv5.12.0-beta1BogDan Vatra2018-10-021-1/+1
| | | | | | | | Needed to fix "No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android" Change-Id: I62d9bae0bf424bb9ba32adce98426245922a841b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Update gradle filesBogDan Vatra2018-03-231-5/+5
| | | | | Change-Id: I7324082ef9eb19cb0851a0a53e8e41ee8f174210 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Use latest stable version of the android:gradle pluginBogDan Vatra2017-04-111-1/+1
| | | | | Change-Id: I15418015c6a206dd1a8e4b52894ec83ddaeb9fc2 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Add gradle wrapper to Qt & update default Andriod gradle pluginBogDan Vatra2017-03-231-1/+1
| | | | | | | | | We need to add gradle wrapper to Qt because it was removed from latest Android SDK. Adding it to Qt, will give us more control and will save us from pain in the future. Task-number: QTBUG-59237 Change-Id: I6419876f8be11c0feeac448b228a46f811065264 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Android: update android gradle plugin versionBogDan Vatra2015-03-231-1/+1
| | | | | Change-Id: Id2a53edd5206f57c3b281293ab561a7775f94546 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Update gradle build script.BogDan Vatra2014-12-181-3/+9
| | | | | Change-Id: If5142c039b6307660402f1dbd30ded75e12f8c50 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Android: Say hello to gradle!BogDan Vatra2014-08-071-0/+51
Add build.gradle script, move Android template files to another folder. These files are specific to every project, and they should be copied to then project android folder. Switching from Ant to Gradle brings lots of advantages: - it is way faster when rebuilding (25-50% faster than ant). - it enables first class Android Studio integration. - adding Android Extras libs (e.g. Google Play services, OBB, etc.) to your project is now painless. [ChangeLog][Android] Added Gradle support to build the APK. Change-Id: I9c8cb355118c9ac1997270c8b80916eca43fce4d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>