summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuya@meta.com>2022-10-18 21:39:43 -0700
committerFredia Huya-Kouadio <fhuya@meta.com>2022-11-30 11:16:59 -0800
commit2aba13e8fbba9ece140ebc3aeb8ae824e9d22f0a (patch)
tree65b374f2309476a80e002f99cf672d8d70e4ab61 /platform/android
parent0bb1e89fb7046209f64d46ccedc6b42645c96573 (diff)
Updating the minimum Android target api for proper Vulkan support
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/detect.py25
-rw-r--r--platform/android/export/export_plugin.cpp2
-rw-r--r--platform/android/java/app/config.gradle9
-rw-r--r--platform/android/java/nativeSrcsConfigs/CMakeLists.txt2
4 files changed, 25 insertions, 13 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py
index d4d6154472..ec36a40941 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -24,7 +24,11 @@ def can_build():
def get_opts():
return [
("ANDROID_SDK_ROOT", "Path to the Android SDK", get_env_android_sdk_root()),
- ("ndk_platform", 'Target platform (android-<api>, e.g. "android-24")', "android-24"),
+ (
+ "ndk_platform",
+ 'Target platform (android-<api>, e.g. "android-' + str(get_min_target_api()) + '")',
+ "android-" + str(get_min_target_api()),
+ ),
]
@@ -46,6 +50,11 @@ def get_ndk_version():
return "23.2.8568313"
+# This is kept in sync with the value in 'platform/android/java/app/config.gradle'.
+def get_min_target_api():
+ return 21
+
+
def get_flags():
return [
("arch", "arm64"), # Default for convenience.
@@ -87,18 +96,18 @@ def configure(env: "Environment"):
)
sys.exit()
+ if get_min_sdk_version(env["ndk_platform"]) < get_min_target_api():
+ print(
+ "WARNING: minimum supported Android target api is %d. Forcing target api %d."
+ % (get_min_target_api(), get_min_target_api())
+ )
+ env["ndk_platform"] = "android-" + str(get_min_target_api())
+
install_ndk_if_needed(env)
ndk_root = env["ANDROID_NDK_ROOT"]
# Architecture
- if get_min_sdk_version(env["ndk_platform"]) < 21 and env["arch"] in ["x86_64", "arm64"]:
- print(
- 'WARNING: arch="%s" is not supported with "ndk_platform" lower than "android-21". Forcing platform 21.'
- % env["arch"]
- )
- env["ndk_platform"] = "android-21"
-
if env["arch"] == "arm32":
target_triple = "armv7a-linux-androideabi"
elif env["arch"] == "arm64":
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index c3fba625c6..737e25b270 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -245,7 +245,7 @@ static const int EXPORT_FORMAT_AAB = 1;
static const char *APK_ASSETS_DIRECTORY = "res://android/build/assets";
static const char *AAB_ASSETS_DIRECTORY = "res://android/build/assetPacks/installTime/src/main/assets";
-static const int DEFAULT_MIN_SDK_VERSION = 19; // Should match the value in 'platform/android/java/app/config.gradle#minSdk'
+static const int DEFAULT_MIN_SDK_VERSION = 21; // Should match the value in 'platform/android/java/app/config.gradle#minSdk'
static const int DEFAULT_TARGET_SDK_VERSION = 32; // Should match the value in 'platform/android/java/app/config.gradle#targetSdk'
#ifndef ANDROID_ENABLED
diff --git a/platform/android/java/app/config.gradle b/platform/android/java/app/config.gradle
index e1d9dc4cde..f1b4bfd534 100644
--- a/platform/android/java/app/config.gradle
+++ b/platform/android/java/app/config.gradle
@@ -1,14 +1,17 @@
ext.versions = [
androidGradlePlugin: '7.2.1',
compileSdk : 32,
- minSdk : 19, // Also update 'platform/android/export/export_plugin.cpp#DEFAULT_MIN_SDK_VERSION'
- targetSdk : 32, // Also update 'platform/android/export/export_plugin.cpp#DEFAULT_TARGET_SDK_VERSION'
+ // Also update 'platform/android/export/export_plugin.cpp#DEFAULT_MIN_SDK_VERSION'
+ minSdk : 21,
+ // Also update 'platform/android/export/export_plugin.cpp#DEFAULT_TARGET_SDK_VERSION'
+ targetSdk : 32,
buildTools : '32.0.0',
kotlinVersion : '1.7.0',
fragmentVersion : '1.3.6',
nexusPublishVersion: '1.1.0',
javaVersion : 11,
- ndkVersion : '23.2.8568313' // Also update 'platform/android/detect.py#get_ndk_version()' when this is updated.
+ // Also update 'platform/android/detect.py#get_ndk_version()' when this is updated.
+ ndkVersion : '23.2.8568313'
]
diff --git a/platform/android/java/nativeSrcsConfigs/CMakeLists.txt b/platform/android/java/nativeSrcsConfigs/CMakeLists.txt
index 1325063a57..e1534c7685 100644
--- a/platform/android/java/nativeSrcsConfigs/CMakeLists.txt
+++ b/platform/android/java/nativeSrcsConfigs/CMakeLists.txt
@@ -17,4 +17,4 @@ target_include_directories(${PROJECT_NAME}
SYSTEM PUBLIC
${GODOT_ROOT_DIR})
-add_definitions(-DUNIX_ENABLED -DVULKAN_ENABLED -DANDROID_ENABLED -DGLES3_ENABLED)
+add_definitions(-DUNIX_ENABLED -DVULKAN_ENABLED -DANDROID_ENABLED -DGLES3_ENABLED -DTOOLS_ENABLED)