File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed
Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,20 @@ android {
9292 }
9393 }
9494
95+ // 使用更简单的方法来自定义文件名,避免兼容性问题
96+ applicationVariants. all { variant ->
97+ variant. outputs. all { output ->
98+ // 使用更安全的方法获取 ABI 信息
99+ def abiName = output. getFilter(" ABI" )
100+ def fileName = " OpenListF-v${ variant.versionName} "
101+ if (abiName != null && ! abiName. isEmpty()) {
102+ fileName + = " _${ abiName} "
103+ }
104+ fileName + = " .apk"
105+ outputFileName = fileName
106+ }
107+ }
108+
95109// kotlin {
96110// jvmToolchain = 17
97111// }
@@ -116,20 +130,6 @@ android {
116130 }
117131}
118132
119- // 使用新版 AGP 推荐的 androidComponents API 来自定义文件名
120- androidComponents {
121- onVariants { variant ->
122- variant. outputs. forEach { output ->
123- def abi = output. getFilter(com.android.build.OutputFile . ABI )
124- if (abi != null ) {
125- output. outputFileName. set(" OpenListF-v${ variant.versionName} _${ abi} .apk" )
126- } else {
127- output. outputFileName. set(" OpenListF-v${ variant.versionName} .apk" )
128- }
129- }
130- }
131- }
132-
133133flutter {
134134 source ' ../..'
135135}
You can’t perform that action at this time.
0 commit comments