From f3f9d1b523f81cfc0d8730ffa060f9ed4fd588ae Mon Sep 17 00:00:00 2001 From: leo60228 Date: Tue, 5 Sep 2023 13:11:13 -0400 Subject: [PATCH] Enable ABI splits This is somewhat convenient for development, as it means that Android Studio will only do a native build for the architecture of the device being used for testing. This is ignored for AABs, so it won't affect release builds (at least for Google Play). --- .../VVVVVV-android/app/build.gradle | 7 ++- .../app/release/output-metadata.json | 50 +++++++++++++++++-- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/desktop_version/VVVVVV-android/app/build.gradle b/desktop_version/VVVVVV-android/app/build.gradle index 3aec93bb..67a24b83 100644 --- a/desktop_version/VVVVVV-android/app/build.gradle +++ b/desktop_version/VVVVVV-android/app/build.gradle @@ -20,7 +20,6 @@ android { externalNativeBuild { cmake { arguments "-DANDROID_APP_PLATFORM=android-19", "-DANDROID_STL=c++_static" - abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' } } } @@ -63,6 +62,12 @@ android { } } } + + splits { + abi { + enable true + } + } } dependencies { diff --git a/desktop_version/VVVVVV-android/app/release/output-metadata.json b/desktop_version/VVVVVV-android/app/release/output-metadata.json index 8dfaa4da..44599792 100644 --- a/desktop_version/VVVVVV-android/app/release/output-metadata.json +++ b/desktop_version/VVVVVV-android/app/release/output-metadata.json @@ -8,12 +8,56 @@ "variantName": "release", "elements": [ { - "type": "SINGLE", - "filters": [], + "type": "ONE_OF_MANY", + "filters": [ + { + "filterType": "ABI", + "value": "armeabi-v7a" + } + ], "attributes": [], "versionCode": 1, "versionName": "1.0", - "outputFile": "app-release.apk" + "outputFile": "app-armeabi-v7a-release.apk" + }, + { + "type": "ONE_OF_MANY", + "filters": [ + { + "filterType": "ABI", + "value": "arm64-v8a" + } + ], + "attributes": [], + "versionCode": 1, + "versionName": "1.0", + "outputFile": "app-arm64-v8a-release.apk" + }, + { + "type": "ONE_OF_MANY", + "filters": [ + { + "filterType": "ABI", + "value": "x86_64" + } + ], + "attributes": [], + "versionCode": 1, + "versionName": "1.0", + "outputFile": "app-x86_64-release.apk" + }, + { + "type": "ONE_OF_MANY", + "filters": [ + { + "filterType": "ABI", + "value": "x86" + } + ], + "attributes": [], + "versionCode": 1, + "versionName": "1.0", + "outputFile": "app-x86-release.apk" } ], "elementType": "File"