Updated to Android minSdkVersion 19 and targetSdkVersion 34 This is updated to meet the latest requirements for apps on the Google Play store (cherry picked from commit 8e27a693706a76cbe0fcd1b877a2847afe19c513)
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
diff --git a/android-project/app/build.gradle b/android-project/app/build.gradle
index baa0edc..c604361 100644
--- a/android-project/app/build.gradle
+++ b/android-project/app/build.gradle
@@ -8,22 +8,22 @@ else {
}
android {
- compileSdkVersion 31
+ if (buildAsApplication) {
+ namespace "org.libsdl.app"
+ }
+ compileSdkVersion 34
defaultConfig {
- if (buildAsApplication) {
- applicationId "org.libsdl.app"
- }
- minSdkVersion 16
- targetSdkVersion 31
+ minSdkVersion 19
+ targetSdkVersion 34
versionCode 1
versionName "1.0"
externalNativeBuild {
ndkBuild {
- arguments "APP_PLATFORM=android-16"
+ arguments "APP_PLATFORM=android-19"
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
// cmake {
- // arguments "-DANDROID_APP_PLATFORM=android-16", "-DANDROID_STL=c++_static"
+ // arguments "-DANDROID_APP_PLATFORM=android-19", "-DANDROID_STL=c++_static"
// // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
// abiFilters 'arm64-v8a'
// }
@@ -53,10 +53,10 @@ android {
}
}
- lintOptions {
+ lint {
abortOnError false
}
-
+
if (buildAsLibrary) {
libraryVariants.all { variant ->
variant.outputs.each { output ->
diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml
index d997afe..e0d0334 100644
--- a/android-project/app/src/main/AndroidManifest.xml
+++ b/android-project/app/src/main/AndroidManifest.xml
@@ -3,7 +3,6 @@
com.gamemaker.game
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="org.libsdl.app"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
diff --git a/android-project/build.gradle b/android-project/build.gradle
index 6f629c8..2c911c6 100644
--- a/android-project/build.gradle
+++ b/android-project/build.gradle
@@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.0.3'
+ classpath 'com.android.tools.build:gradle:8.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/android-project/gradle/wrapper/gradle-wrapper.properties b/android-project/gradle/wrapper/gradle-wrapper.properties
index ada5af4..5b9d759 100644
--- a/android-project/gradle/wrapper/gradle-wrapper.properties
+++ b/android-project/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Thu Nov 11 18:20:34 PST 2021
distributionBase=GRADLE_USER_HOME
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
diff --git a/docs/README-android.md b/docs/README-android.md
index dc7eb5b..5e25cab 100644
--- a/docs/README-android.md
+++ b/docs/README-android.md
@@ -13,13 +13,13 @@ supported, but you can use the "android-project-ant" directory as a template.
Requirements
================================================================================
-Android SDK (version 31 or later)
+Android SDK (version 34 or later)
https://developer.android.com/sdk/index.html
Android NDK r15c or later
https://developer.android.com/tools/sdk/ndk/index.html
-Minimum API level supported by SDL: 16 (Android 4.1)
+Minimum API level supported by SDL: 19 (Android 4.4)
How the port works
@@ -431,13 +431,13 @@ The Tegra Graphics Debugger is available from NVidia here:
https://developer.nvidia.com/tegra-graphics-debugger
-Why is API level 16 the minimum required?
+Why is API level 19 the minimum required?
================================================================================
-The latest NDK toolchain doesn't support targeting earlier than API level 16.
-As of this writing, according to https://developer.android.com/about/dashboards/index.html
-about 99% of the Android devices accessing Google Play support API level 16 or
-higher (January 2018).
+The latest NDK toolchain doesn't support targeting earlier than API level 19.
+As of this writing, according to https://www.composables.com/tools/distribution-chart
+about 99.7% of the Android devices accessing Google Play support API level 19 or
+higher (August 2023).
A note regarding the use of the "dirty rectangles" rendering technique