From b7169ed5be6f142f712cec6e3e8292807d55dddd Mon Sep 17 00:00:00 2001 From: Runar Heggset Date: Fri, 31 May 2024 19:49:16 +0200 Subject: [PATCH] Use correct type for abi version code (#149087) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- packages/flutter_tools/gradle/src/main/groovy/flutter.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy b/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy index 62e74a657a..8c759c6c60 100644 --- a/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy +++ b/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy @@ -1225,7 +1225,7 @@ class FlutterPlugin implements Plugin { // for only the output APK, not for the variant itself. Skipping this step simply // causes Gradle to use the value of variant.versionCode for the APK. // For more, see https://developer.android.com/studio/build/configure-apk-splits - int abiVersionCode = ABI_VERSION.get(output.getFilter(OutputFile.ABI)) + Integer abiVersionCode = ABI_VERSION.get(output.getFilter(OutputFile.ABI)) if (abiVersionCode != null) { output.versionCodeOverride = abiVersionCode * 1000 + variant.versionCode