@@ -57,6 +57,16 @@ android {
5757 }
5858 }
5959
60+ splits {
61+ abi {
62+ isEnable = true
63+ isUniversalApk = true
64+
65+ reset()
66+ include(" arm64-v8a" , " armeabi-v7a" , " x86_64" , " x86" )
67+ }
68+ }
69+
6070 buildTypes {
6171 release {
6272 isMinifyEnabled = true
@@ -66,38 +76,11 @@ android {
6676 getDefaultProguardFile(" proguard-android-optimize.txt" ),
6777 " proguard-rules.pro"
6878 )
69-
70- splits {
71- abi {
72- isEnable = true
73- reset()
74- include(" arm64-v8a" , " armeabi-v7a" , " x86_64" , " x86" )
75- }
76- }
7779 }
7880
7981 create(" githubRelease" ) {
8082 initWith(getByName(" release" ))
81- signingConfig = signingConfigs.getByName(" release" )
82-
83- splits {
84- abi {
85- isUniversalApk = true
86- }
87- }
88- }
89-
90- create(" staging" ) {
91- initWith(getByName(" debug" ))
92-
93- ndk {
94- splits {
95- abi {
96- isEnable = false
97- }
98- }
99- abiFilters.add(" arm64-v8a" )
100- }
83+ // signingConfig = signingConfigs.getByName("release")
10184 }
10285 }
10386
@@ -134,15 +117,14 @@ android {
134117 // rename the output APK file
135118 outputs.configureEach {
136119 val isRelease = buildType.name.lowercase().contains(" release" )
137- val abiName = " -" + if (filters.any { it.filterType == " ABI" }) {
138- filters.find { it.filterType == " ABI" }?.identifier ? : " universal"
139- } else " universal"
140- val abiSuffix = if (isRelease) abiName else " "
120+ val abiName = if (filters.any { it.filterType == " ABI" }) {
121+ " -" + filters.find { it.filterType == " ABI" }?.identifier
122+ } else " "
141123 (this as ApkVariantOutputImpl ).outputFileName =
142124 " ${rootProject.name.lowercase()}${
143125 if (isRelease) " -"
144126 else " -${buildType.name} -"
145- }${defaultConfig.versionName}$abiSuffix .apk"
127+ }${defaultConfig.versionName}$abiName .apk"
146128 }
147129 }
148130}
0 commit comments