From fa7f487595dfdf5a7327f43655c17dc0211ba60a Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Tue, 9 Nov 2021 20:08:01 -0500 Subject: [PATCH 01/15] Replace `ndk.dir` with `ndkPath`. https://developer.android.com/studio/projects/configure-agp-ndk#agp_version_41 The documentation tells you to be careful about this, since you're putting local-only information into a file that gets uploaded to version control, but Lime doesn't really need to worry about that. Granted, Lime DID use local.properties, but that's no longer practical. --- templates/android/template/app/build.gradle | 1 + templates/android/template/build.gradle | 1 + templates/android/template/local.properties | 2 ++ 3 files changed, 4 insertions(+) diff --git a/templates/android/template/app/build.gradle b/templates/android/template/app/build.gradle index c01e8356f..704bbca33 100644 --- a/templates/android/template/app/build.gradle +++ b/templates/android/template/app/build.gradle @@ -10,6 +10,7 @@ System.setProperty('java.awt.headless','false') android { compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION + ::if (ANDROID_GRADLE_PLUGIN>="4.0")::ndkPath '::ANDROID_NDK_ROOT_ESCAPED::'::end:: defaultConfig { applicationId "::META_PACKAGE_NAME::" diff --git a/templates/android/template/build.gradle b/templates/android/template/build.gradle index 81fe8a266..09a91e1e2 100644 --- a/templates/android/template/build.gradle +++ b/templates/android/template/build.gradle @@ -46,6 +46,7 @@ configure(subprojects.findAll {!it.file('build.gradle').exists() && it.file('bui android { compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION + ::if (ANDROID_GRADLE_PLUGIN>="4.0")::ndkPath '::ANDROID_NDK_ROOT_ESCAPED::'::end:: sourceSets { main { diff --git a/templates/android/template/local.properties b/templates/android/template/local.properties index 09b9bb3db..0a1bbe0cf 100644 --- a/templates/android/template/local.properties +++ b/templates/android/template/local.properties @@ -4,4 +4,6 @@ # Location of the SDK. This is only used by Gradle. # sdk.dir=::ANDROID_SDK_ESCAPED:: +::if (ANDROID_GRADLE_PLUGIN<"4.0"):: ndk.dir=::ANDROID_NDK_ROOT_ESCAPED:: +::end:: From ded22af195cf6a8b8d3367567632019ac3fbaec0 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Tue, 9 Nov 2021 20:10:37 -0500 Subject: [PATCH 02/15] Replace references to `jcenter()`. https://developer.android.com/studio/build/jcenter-migration Gradle considers this function a "deprecated feature." --- dependencies/extension-api/build.gradle | 2 +- templates/android/template/build.gradle | 6 +++--- templates/extension/dependencies/android/build.gradle | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dependencies/extension-api/build.gradle b/dependencies/extension-api/build.gradle index b211a7eff..59135e332 100644 --- a/dependencies/extension-api/build.gradle +++ b/dependencies/extension-api/build.gradle @@ -1,6 +1,6 @@ buildscript { repositories { - jcenter() + mavenCentral() google() } diff --git a/templates/android/template/build.gradle b/templates/android/template/build.gradle index 09a91e1e2..9861c1ad0 100644 --- a/templates/android/template/build.gradle +++ b/templates/android/template/build.gradle @@ -2,7 +2,7 @@ buildscript { repositories { - jcenter() + mavenCentral() google() } dependencies { @@ -15,7 +15,7 @@ buildscript { allprojects { repositories { - jcenter() + mavenCentral() google() }::if ANDROID_GRADLE_BUILD_DIRECTORY:: buildDir = "::ANDROID_GRADLE_BUILD_DIRECTORY::/::APP_FILE::/${project.name}"::end:: @@ -32,7 +32,7 @@ wrapper { configure(subprojects.findAll {!it.file('build.gradle').exists() && it.file('build.xml').exists()}) { buildscript { repositories { - jcenter() + mavenCentral() google() } diff --git a/templates/extension/dependencies/android/build.gradle b/templates/extension/dependencies/android/build.gradle index b4e2751d9..d3afb5503 100644 --- a/templates/extension/dependencies/android/build.gradle +++ b/templates/extension/dependencies/android/build.gradle @@ -1,6 +1,6 @@ buildscript { repositories { - jcenter() + mavenCentral() google() } From f81439d1d2b2ce322b49fa5543d7766c1108693d Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Tue, 9 Nov 2021 20:12:21 -0500 Subject: [PATCH 03/15] Use androidX when available. https://developer.android.com/jetpack/androidx/ --- templates/android/template/gradle.properties | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/android/template/gradle.properties b/templates/android/template/gradle.properties index dff152bc8..a33d2c78e 100644 --- a/templates/android/template/gradle.properties +++ b/templates/android/template/gradle.properties @@ -21,6 +21,11 @@ ANDROID_BUILD_MIN_SDK_VERSION=::ANDROID_MINIMUM_SDK_VERSION:: ANDROID_BUILD_SDK_VERSION=::ANDROID_TARGET_SDK_VERSION:: ANDROID_BUILD_TOOLS_VERSION=::ANDROID_BUILD_TOOLS_VERSION:: +::if (ANDROID_TARGET_SDK_VERSION>=28):: +android.useAndroidX=true +android.enableJetifier=true +::end:: + ::if KEY_STORE:: KEY_STORE=::KEY_STORE:: KEY_STORE_PASSWORD=::KEY_STORE_PASSWORD:: From 87611eeed1f2fdbf4c90aa0160278518822b6e50 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Tue, 9 Nov 2021 20:17:22 -0500 Subject: [PATCH 04/15] Remove uses-sdk tag. This is now redundant, and sometimes even causes builds to fail. --- templates/android/template/app/src/main/AndroidManifest.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/android/template/app/src/main/AndroidManifest.xml b/templates/android/template/app/src/main/AndroidManifest.xml index 22bb94f94..73a2b61ae 100644 --- a/templates/android/template/app/src/main/AndroidManifest.xml +++ b/templates/android/template/app/src/main/AndroidManifest.xml @@ -7,8 +7,6 @@ ::if (ANDROID_PERMISSIONS != null)::::foreach ANDROID_PERMISSIONS:: ::end::::end:: - - ::if (WIN_ORIENTATION=="portrait"):: From 96bfa805cf1a9009f814907ce9bd476b02db6f2a Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Tue, 9 Nov 2021 20:21:46 -0500 Subject: [PATCH 05/15] Add instructions to debug Java classes. The Java compiler complains about deprecated features and unsafe operations, but it's surprisingly hard to get the details. Here's how. --- templates/android/template/app/build.gradle | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/templates/android/template/app/build.gradle b/templates/android/template/app/build.gradle index 704bbca33..998bfff79 100644 --- a/templates/android/template/app/build.gradle +++ b/templates/android/template/app/build.gradle @@ -1,12 +1,17 @@ import groovy.swing.SwingBuilder -import java.awt.GridBagLayout; -import java.awt.GridBagConstraints; -import javax.swing.border.EmptyBorder; +import java.awt.GridBagLayout +import java.awt.GridBagConstraints +import javax.swing.border.EmptyBorder apply plugin: 'com.android.application' System.setProperty('java.awt.headless','false') +//Uncomment to debug deprecation warnings. +/* tasks.withType(JavaCompile) { + options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" +} */ + android { compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION From 8bcbafd587a15eea6b6d9798114cbb46549d1850 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Tue, 9 Nov 2021 20:30:34 -0500 Subject: [PATCH 06/15] Update the Android Gradle Plugin. --- .../template/app/src/main/AndroidManifest.xml | 20 +++++++++---------- tools/platforms/AndroidPlatform.hx | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/templates/android/template/app/src/main/AndroidManifest.xml b/templates/android/template/app/src/main/AndroidManifest.xml index 73a2b61ae..9ee1587e5 100644 --- a/templates/android/template/app/src/main/AndroidManifest.xml +++ b/templates/android/template/app/src/main/AndroidManifest.xml @@ -1,12 +1,12 @@ - + - + ::if (ANDROID_PERMISSIONS != null)::::foreach ANDROID_PERMISSIONS:: ::end::::end:: - + ::if (WIN_ORIENTATION=="portrait"):: @@ -17,18 +17,18 @@ ::end:: - - + + - + - + - + - + - + diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx index 6d4d5b9f9..1ce02dee4 100644 --- a/tools/platforms/AndroidPlatform.hx +++ b/tools/platforms/AndroidPlatform.hx @@ -459,8 +459,8 @@ class AndroidPlatform extends PlatformTarget "android.permission.VIBRATE", "android.permission.ACCESS_NETWORK_STATE" ]); - context.ANDROID_GRADLE_VERSION = project.config.getString("android.gradle-version", "5.6.3"); - context.ANDROID_GRADLE_PLUGIN = project.config.getString("android.gradle-plugin", "3.5.1"); + context.ANDROID_GRADLE_VERSION = project.config.getString("android.gradle-version", "7.0.2"); + context.ANDROID_GRADLE_PLUGIN = project.config.getString("android.gradle-plugin", "7.0.1"); context.ANDROID_LIBRARY_PROJECTS = []; From 46acd3b3735aaa279d53ef91f22d79aaa600bb3a Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Tue, 9 Nov 2021 20:36:39 -0500 Subject: [PATCH 07/15] Target Android API level 30. https://developer.android.com/distribute/best-practices/develop/target-sdk --- templates/android/template/app/src/main/AndroidManifest.xml | 2 +- tools/platforms/AndroidPlatform.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/android/template/app/src/main/AndroidManifest.xml b/templates/android/template/app/src/main/AndroidManifest.xml index 9ee1587e5..f89e04a43 100644 --- a/templates/android/template/app/src/main/AndroidManifest.xml +++ b/templates/android/template/app/src/main/AndroidManifest.xml @@ -7,7 +7,7 @@ ::if (ANDROID_PERMISSIONS != null)::::foreach ANDROID_PERMISSIONS:: ::end::::end:: - + =30):: android:allowNativeHeapPointerTagging="false" ::end::> ::if (WIN_ORIENTATION=="portrait"):: diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx index 1ce02dee4..372ce569e 100644 --- a/tools/platforms/AndroidPlatform.hx +++ b/tools/platforms/AndroidPlatform.hx @@ -451,7 +451,7 @@ class AndroidPlatform extends PlatformTarget context.OUTPUT_DIR = targetDirectory; context.ANDROID_INSTALL_LOCATION = project.config.getString("android.install-location", "auto"); context.ANDROID_MINIMUM_SDK_VERSION = project.config.getInt("android.minimum-sdk-version", 16); - context.ANDROID_TARGET_SDK_VERSION = project.config.getInt("android.target-sdk-version", 28); + context.ANDROID_TARGET_SDK_VERSION = project.config.getInt("android.target-sdk-version", 30); context.ANDROID_EXTENSIONS = project.config.getArrayString("android.extension"); context.ANDROID_PERMISSIONS = project.config.getArrayString("android.permission", [ "android.permission.WAKE_LOCK", From b03edaec730afca4dc6d0fd9027d4a52f0590066 Mon Sep 17 00:00:00 2001 From: player-03 Date: Sun, 5 Jun 2022 23:53:53 -0400 Subject: [PATCH 08/15] Use Java 11 to build Android. This is required by the newer Gradle plugin. --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 26fb1e137..a03ce4b6a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -215,7 +215,7 @@ jobs: - uses: actions/setup-java@v1 with: - java-version: 8 + java-version: 11 - uses: krdlab/setup-haxe@v1 with: @@ -460,7 +460,7 @@ jobs: - uses: actions/setup-java@v1 with: - java-version: 8 + java-version: 11 - uses: krdlab/setup-haxe@v1 with: From 1ff434043cb2aefda4552050d5348b4d35110407 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Sat, 11 Jun 2022 19:42:59 -0400 Subject: [PATCH 09/15] Remove trailing spaces. --- dependencies/extension-api/build.gradle | 4 ++-- templates/android/template/app/build.gradle | 22 +++++++++---------- templates/android/template/build.gradle | 12 +++++----- .../dependencies/android/build.gradle | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dependencies/extension-api/build.gradle b/dependencies/extension-api/build.gradle index 59135e332..fe526ccdb 100644 --- a/dependencies/extension-api/build.gradle +++ b/dependencies/extension-api/build.gradle @@ -3,7 +3,7 @@ buildscript { mavenCentral() google() } - + dependencies { classpath 'com.android.tools.build:gradle:::ANDROID_GRADLE_PLUGIN::' } @@ -14,7 +14,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION - + defaultConfig { minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION) targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) diff --git a/templates/android/template/app/build.gradle b/templates/android/template/app/build.gradle index 998bfff79..40aa08b13 100644 --- a/templates/android/template/app/build.gradle +++ b/templates/android/template/app/build.gradle @@ -16,7 +16,7 @@ android { compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION ::if (ANDROID_GRADLE_PLUGIN>="4.0")::ndkPath '::ANDROID_NDK_ROOT_ESCAPED::'::end:: - + defaultConfig { applicationId "::META_PACKAGE_NAME::" minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION) @@ -25,7 +25,7 @@ android { versionName project.VERSION_NAME ::if (languages != null)::resConfigs ::foreach languages::"::__current__::", ::end::""::end:: } - + ::if KEY_STORE:: signingConfigs { if (project.KEY_STORE_PASSWORD == 'null') { @@ -33,11 +33,11 @@ android { keyStoreFile = keyStoreFile[keyStoreFile.length - 1] project.KEY_STORE_PASSWORD = getPassword('\nPlease enter key password for ' + keyStoreFile + ':'); } - + if (project.KEY_STORE_ALIAS_PASSWORD == 'null') { project.KEY_STORE_ALIAS_PASSWORD = getPassword("\nPlease enter key alias password for alias " + project.KEY_STORE_ALIAS + ":") } - + release { storeFile file(project.KEY_STORE) storePassword project.KEY_STORE_PASSWORD @@ -50,7 +50,7 @@ android { if(signingFile.exists()) { Properties signing = new Properties() signing.load(new FileInputStream(signingFile)) - + signingConfigs { release { storeFile file(signing["KEY_STORE"]) @@ -65,14 +65,14 @@ android { } } ::end:: - + buildTypes { release { minifyEnabled false signingConfig signingConfigs.release } } - + android.applicationVariants.all { variant -> variant.outputs.all { output -> if (outputFileName != null && outputFileName.endsWith('.apk')) { @@ -103,11 +103,11 @@ def getPassword(message) { show: true ) { lookAndFeel('system') - + panel(border: new EmptyBorder(10, 10, 10, 10)) { gridBagLayout() def gbc = new GridBagConstraints(); - + gbc.gridx = 0 gbc.gridy = 0 gbc.fill = GridBagConstraints.HORIZONTAL @@ -119,10 +119,10 @@ def getPassword(message) { '' + '', constraints: gbc) - + gbc.gridy = 1 input = passwordField(constraints: gbc) - + gbc.gridy = 2 gbc.fill = GridBagConstraints.NONE gbc.insets = [0, 0, 0, 0] diff --git a/templates/android/template/build.gradle b/templates/android/template/build.gradle index 9861c1ad0..859cba6fa 100644 --- a/templates/android/template/build.gradle +++ b/templates/android/template/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:::ANDROID_GRADLE_PLUGIN::' - + // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -35,19 +35,19 @@ configure(subprojects.findAll {!it.file('build.gradle').exists() && it.file('bui mavenCentral() google() } - + dependencies { classpath 'com.android.tools.build:gradle:::ANDROID_GRADLE_PLUGIN::' } } - + apply plugin: 'android-library' - + android { compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION ::if (ANDROID_GRADLE_PLUGIN>="4.0")::ndkPath '::ANDROID_NDK_ROOT_ESCAPED::'::end:: - + sourceSets { main { manifest.srcFile 'AndroidManifest.xml' @@ -56,7 +56,7 @@ configure(subprojects.findAll {!it.file('build.gradle').exists() && it.file('bui } } } - + dependencies { api fileTree(dir: 'libs', include: ['*.jar']) api project(':deps:extension-api') diff --git a/templates/extension/dependencies/android/build.gradle b/templates/extension/dependencies/android/build.gradle index d3afb5503..f08ae46f6 100644 --- a/templates/extension/dependencies/android/build.gradle +++ b/templates/extension/dependencies/android/build.gradle @@ -3,7 +3,7 @@ buildscript { mavenCentral() google() } - + dependencies { classpath 'com.android.tools.build:gradle:::::if (1 == 1)::ANDROID_GRADLE_PLUGIN::end::::' } From 619b67b4722fb0f4f22d56c314add6acfec83114 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Sat, 11 Jun 2022 19:58:58 -0400 Subject: [PATCH 10/15] Remove reference to nonexistant folder. libs/ doesn't exist; only app/libs/ does, and that's handled by app/build.gradle. --- templates/android/template/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/android/template/build.gradle b/templates/android/template/build.gradle index 859cba6fa..7ffb01761 100644 --- a/templates/android/template/build.gradle +++ b/templates/android/template/build.gradle @@ -58,7 +58,6 @@ configure(subprojects.findAll {!it.file('build.gradle').exists() && it.file('bui } dependencies { - api fileTree(dir: 'libs', include: ['*.jar']) api project(':deps:extension-api') } } From 00fd063026c0ddb72ee57d5c90523e1b407d0c8c Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Sat, 11 Jun 2022 20:08:54 -0400 Subject: [PATCH 11/15] Use `implementation` instead of `api`. This is recommended as a best practice, though AFAIK this only matters for projects that are going to be imported by other projects. For instance, you used to be able to include `:deps:extension-api` by including any extension that depended on it. Now, every project that wants to use `extension-api` has to include it directly. (Which is fine because in practice, they all already do so.) --- templates/android/template/app/build.gradle | 4 ++-- templates/android/template/build.gradle | 2 +- templates/extension/dependencies/android/build.gradle | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/android/template/app/build.gradle b/templates/android/template/app/build.gradle index 40aa08b13..d2e5260d6 100644 --- a/templates/android/template/app/build.gradle +++ b/templates/android/template/app/build.gradle @@ -83,8 +83,8 @@ android { } dependencies { - api fileTree(dir: 'libs', include: ['*.jar']) - ::if (ANDROID_LIBRARY_PROJECTS)::::foreach (ANDROID_LIBRARY_PROJECTS)::api project(':deps:::name::') + implementation fileTree(dir: 'libs', include: ['*.jar']) + ::if (ANDROID_LIBRARY_PROJECTS)::::foreach (ANDROID_LIBRARY_PROJECTS)::implementation project(':deps:::name::') ::end::::end:: } diff --git a/templates/android/template/build.gradle b/templates/android/template/build.gradle index 7ffb01761..55388aaba 100644 --- a/templates/android/template/build.gradle +++ b/templates/android/template/build.gradle @@ -58,6 +58,6 @@ configure(subprojects.findAll {!it.file('build.gradle').exists() && it.file('bui } dependencies { - api project(':deps:extension-api') + implementation project(':deps:extension-api') } } diff --git a/templates/extension/dependencies/android/build.gradle b/templates/extension/dependencies/android/build.gradle index f08ae46f6..8b5014f91 100644 --- a/templates/extension/dependencies/android/build.gradle +++ b/templates/extension/dependencies/android/build.gradle @@ -17,5 +17,5 @@ android { } dependencies { - api project(':deps:extension-api') + implementation project(':deps:extension-api') } From 5ffbfd7f3a09bd9ff889f3f2e4f5cd0d51817b02 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Sat, 11 Jun 2022 20:20:33 -0400 Subject: [PATCH 12/15] Add AndroidX options to ``. `enableJetifier` defaults to false because it can slow compilation. --- templates/android/template/gradle.properties | 6 ++---- tools/platforms/AndroidPlatform.hx | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/android/template/gradle.properties b/templates/android/template/gradle.properties index a33d2c78e..a1cbbf426 100644 --- a/templates/android/template/gradle.properties +++ b/templates/android/template/gradle.properties @@ -20,12 +20,10 @@ ANDROID_BUILD_TARGET_SDK_VERSION=::ANDROID_TARGET_SDK_VERSION:: ANDROID_BUILD_MIN_SDK_VERSION=::ANDROID_MINIMUM_SDK_VERSION:: ANDROID_BUILD_SDK_VERSION=::ANDROID_TARGET_SDK_VERSION:: ANDROID_BUILD_TOOLS_VERSION=::ANDROID_BUILD_TOOLS_VERSION:: - ::if (ANDROID_TARGET_SDK_VERSION>=28):: -android.useAndroidX=true -android.enableJetifier=true +android.useAndroidX=::ANDROID_USE_ANDROIDX:: +android.enableJetifier=::ANDROID_ENABLE_JETIFIER:: ::end:: - ::if KEY_STORE:: KEY_STORE=::KEY_STORE:: KEY_STORE_PASSWORD=::KEY_STORE_PASSWORD:: diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx index 372ce569e..1da56cbd8 100644 --- a/tools/platforms/AndroidPlatform.hx +++ b/tools/platforms/AndroidPlatform.hx @@ -461,6 +461,8 @@ class AndroidPlatform extends PlatformTarget ]); context.ANDROID_GRADLE_VERSION = project.config.getString("android.gradle-version", "7.0.2"); context.ANDROID_GRADLE_PLUGIN = project.config.getString("android.gradle-plugin", "7.0.1"); + context.ANDROID_USE_ANDROIDX = project.config.getString("android.useAndroidX", "true"); + context.ANDROID_ENABLE_JETIFIER = project.config.getString("android.enableJetifier", "false"); context.ANDROID_LIBRARY_PROJECTS = []; From 2a2b5ebd22cd3cfce8dcebcaff93643014f50cb3 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Sun, 12 Jun 2022 13:22:00 -0400 Subject: [PATCH 13/15] Update Android SDK setup instructions. Not only are we no longer targeting API 19, the minimum is now 21. --- tools/utils/PlatformSetup.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/utils/PlatformSetup.hx b/tools/utils/PlatformSetup.hx index 6b5274089..986948ae7 100644 --- a/tools/utils/PlatformSetup.hx +++ b/tools/utils/PlatformSetup.hx @@ -589,7 +589,7 @@ class PlatformSetup Log.println("\x1b[1mIn order to build applications for Android, you must have recent"); Log.println("versions of the Android SDK, Android NDK and Java JDK installed."); Log.println(""); - Log.println("You must also install the Android SDK Platform-tools and API 19 using"); + Log.println("You must also install the Android SDK Platform-tools and API 30 using"); Log.println("the SDK manager from Android Studio.\x1b[0m"); Log.println(""); From 4634755a56b20d9b161fd6d8c7dfb54462e2eff4 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Wed, 7 Sep 2022 14:00:52 -0400 Subject: [PATCH 14/15] Disable pointer tagging. (For real this time.) https://source.android.com/docs/security/test/tagged-pointers --- templates/android/template/app/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/android/template/app/src/main/AndroidManifest.xml b/templates/android/template/app/src/main/AndroidManifest.xml index 2134f1744..af4261bf9 100644 --- a/templates/android/template/app/src/main/AndroidManifest.xml +++ b/templates/android/template/app/src/main/AndroidManifest.xml @@ -7,7 +7,7 @@ ::if (ANDROID_PERMISSIONS != null)::::foreach ANDROID_PERMISSIONS:: ::end::::end:: - =30):: android:allowNativeHeapPointerTagging="false" ::end::> + =30):: android:allowNativeHeapPointerTagging="false" ::end::> ::if (WIN_ORIENTATION=="portrait"):: From 73202191cc2894d0c69929677b5b3fa4e4a9ae74 Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Tue, 20 Dec 2022 14:53:29 -0500 Subject: [PATCH 15/15] Update Gradle. --- tools/platforms/AndroidPlatform.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/platforms/AndroidPlatform.hx b/tools/platforms/AndroidPlatform.hx index e21f34532..47bb6aac0 100644 --- a/tools/platforms/AndroidPlatform.hx +++ b/tools/platforms/AndroidPlatform.hx @@ -459,8 +459,8 @@ class AndroidPlatform extends PlatformTarget "android.permission.VIBRATE", "android.permission.ACCESS_NETWORK_STATE" ]); - context.ANDROID_GRADLE_VERSION = project.config.getString("android.gradle-version", "7.0.2"); - context.ANDROID_GRADLE_PLUGIN = project.config.getString("android.gradle-plugin", "7.0.1"); + context.ANDROID_GRADLE_VERSION = project.config.getString("android.gradle-version", "7.4.2"); + context.ANDROID_GRADLE_PLUGIN = project.config.getString("android.gradle-plugin", "7.3.1"); context.ANDROID_USE_ANDROIDX = project.config.getString("android.useAndroidX", "true"); context.ANDROID_ENABLE_JETIFIER = project.config.getString("android.enableJetifier", "false");