Skip to content

Commit

Permalink
split apks per ABI
Browse files Browse the repository at this point in the history
  • Loading branch information
Totto16 committed Jan 2, 2024
1 parent fcbcd9d commit 7605a71
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: oopetris.aab
path: platforms/android/app/build/outputs/apk/debug/app-debug.apk
name: oopetris.all-apks
path: platforms/android/app/build/outputs/apk/debug/app-*-debug.apk
23 changes: 18 additions & 5 deletions platforms/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ android {
}
minSdkVersion 21
targetSdkVersion 34
versionCode 2
versionName "1.0.2"
versionCode 3
versionName "1.0.3"
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-34"
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
buildTypes {
release {
Expand Down Expand Up @@ -63,6 +60,22 @@ android {
}
}
}
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
enable true
// By default all ABIs are included, so use reset() and include to specify that you only
// want APKs for the ones with a ndk variant (4, android did in the past support more: https://developer.android.com/ndk/guides/abis.html#sa)
// Resets the list of ABIs for Gradle to create APKs for to none.
reset()
// Specifies a list of ABIs for Gradle to create APKs for.
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
// Specifies that you don't want to also generate a universal APK that includes all ABIs.
universalApk false
}
}

}

dependencies {
Expand Down
3 changes: 0 additions & 3 deletions platforms/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,3 @@ for IDX in "${!DESC_ARRAY[@]}"; do
cp -r "./assets/icon/icon_$RES.png" "${DESC_DIR}/ic_launcher.png"

done


# TODO: build seperate apks for all 4 architectures!

0 comments on commit 7605a71

Please sign in to comment.