Skip to content

Commit a0bb892

Browse files
committed
fix(agp):fixed abi version callback
1 parent 7999e50 commit a0bb892

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

android/app/build.gradle

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,6 @@ 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-
10995
// kotlin {
11096
// jvmToolchain = 17
11197
// }
@@ -130,6 +116,21 @@ android {
130116
}
131117
}
132118

119+
androidComponents {
120+
onVariants { variant ->
121+
variant.outputs.forEach { output ->
122+
def abi = output.filters.find { it.filterType.name() == "ABI" }?.identifier
123+
def versionName = variant.versionName.get()
124+
def fileName = "OpenListF-v${versionName}"
125+
if (abi != null && !abi.isEmpty()) {
126+
fileName += "_${abi}"
127+
}
128+
fileName += ".apk"
129+
output.outputFileName.set(fileName)
130+
}
131+
}
132+
}
133+
133134
flutter {
134135
source '../..'
135136
}

0 commit comments

Comments
 (0)