Skip to content

Commit bf31d98

Browse files
runarheggsetvictorsanni
authored andcommitted
Use correct type for abi version code (flutter#149087)
After upgrading flutter to the latest version (3.22.1), I encountered an error when building with `--split-per-abi`: ``` [ +1 ms] FAILURE: Build failed with an exception. [ ] * Where: [ ] Script '/home/runar/snap/flutter/common/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 1182 [ ] * What went wrong: [ ] A problem occurred evaluating root project 'android'. [ ] > A problem occurred configuring project ':app'. [ ] > org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'int'. Try 'java.lang.Integer' instead ``` This PR changes the type used from `ìnt` to `Integer` which is what's used in the `ABI_VERSION` map.
1 parent 26340b3 commit bf31d98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/flutter_tools/gradle/src/main/groovy/flutter.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ class FlutterPlugin implements Plugin<Project> {
12251225
// for only the output APK, not for the variant itself. Skipping this step simply
12261226
// causes Gradle to use the value of variant.versionCode for the APK.
12271227
// For more, see https://developer.android.com/studio/build/configure-apk-splits
1228-
int abiVersionCode = ABI_VERSION.get(output.getFilter(OutputFile.ABI))
1228+
Integer abiVersionCode = ABI_VERSION.get(output.getFilter(OutputFile.ABI))
12291229
if (abiVersionCode != null) {
12301230
output.versionCodeOverride =
12311231
abiVersionCode * 1000 + variant.versionCode

0 commit comments

Comments
 (0)