Skip to content

Commit

Permalink
Split sample APK by ABIs
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancoltech authored Feb 19, 2024
1 parent 643631c commit 2be7202
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,20 @@ jobs:
- name: Build release sample APK
run: ./gradlew sample:assembleRelease

- name: Upload release APK
- name: Upload release arm64-v8a APK
uses: actions/upload-artifact@v3
with:
name: release-arm64-v8a-apk
path: ./sample/build/outputs/apk/release/sample-arm64-v8a-release.apk

- name: Upload release armeabi-v7a APK
uses: actions/upload-artifact@v3
with:
name: release-armeabi-v7a-apk
path: ./sample/build/outputs/apk/release/sample-armeabi-v7a-release.apk

- name: Upload release universal APK
uses: actions/upload-artifact@v3
with:
name: release-universal-apk
path: ./sample/build/outputs/apk/release/sample-release.apk
path: ./sample/build/outputs/apk/release/sample-universal-release.apk
20 changes: 20 additions & 0 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,26 @@ android {
buildFeatures {
buildConfig = true
}

splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
isEnable = true

// By default all ABIs are included, so use reset() and include to specify that you only
// want APKs for armeabi-v7a and arm64-v8a.

// 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")

// Specifies that you don't want to also generate a universal APK that includes all ABIs.
isUniversalApk = true
}
}
}

dependencies {
Expand Down

0 comments on commit 2be7202

Please sign in to comment.