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,20 +92,6 @@ android {
9292 }
9393 }
9494
95- android. applicationVariants. all { variant ->
96- variant. outputs. all { output ->
97- def abiName = null
98- if (output. filters != null && ! output. filters. isEmpty()) {
99- abiName = output. filters. find { it. filterType == com.android.build.OutputFile . ABI }?. identifier
100- }
101- if (abiName == null ) {
102- output. outputFileName = " OpenListF-v${ variant.versionName} .apk"
103- } else {
104- output. outputFileName = " OpenListF-v${ variant.versionName} _${ abiName} .apk"
105- }
106- }
107- }
108-
10995// kotlin {
11096// jvmToolchain = 17
11197// }
@@ -130,6 +116,20 @@ android {
130116 }
131117}
132118
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