-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android build failing when using default build number #58
Comments
For us this started happening when we went from Flutter 1.17.5 to 1.20.0 |
Since Set version to 1.17.5
In addition to using version 1.17.5, if you want to use the latest version of Flutter, which I recommended, there is another way to solve it. ADD like
We can just simply change
For more information about Configure run or build numbers, you can look this up. |
It take me few hour to figure this out but I found workaround how to use build number which you specify in pubspec.yaml (i.g. version: 1.0.1+11) for FlutterBuild. Documentation for this task says it is optional, but some weird number is used, but if you specify build number like: buildNumber: '' (empty quotation marks). Then magic happen and your aplication will be build with build number specified in pubspec.yaml.
|
Issue
Our Flutter build tasks were running without problem and then suddenly started to fail.
The command that was causing the error was:
/Users/runner/hostedtoolcache/Flutter/1.18.0-11.1.pre-beta/macos/flutter/bin/flutter build apk --target-platform=android-arm --build-number=20200611.1
The error was:
OK, makes sense - 20200611.1 is certainly not an integer.
This is not an error with the vsts-flutter-tasks - it is an error from the Android gradle build task. I'm adding it here in case others encounter the same problem.
Solution
The solution is the change how Azure names each pipeline run by adding a 'name' to your pipline yaml.
I chose to use the
BuildID
pipeline variable which is "an internal immutable ID that is also referred to as the Run ID. It is unique across the organization"Explanation
The Flutter Build task uses the
buildNumber
pipeline variable and then passes this as the --build-number to the Android build.The default value for the
buildNumber
assigned by the Azure Pipeline is$(Date:yyyyMMdd).$(Rev:r)
- See the docs..This is not an integer.
To change the value of the buildNumber, we set a 'name' in the pipeline yaml.
(Yeah, it's a nice bit of MS inconsistency that seems to be everywhere in Azure...)
Configuring the build number also changes the 'name' of the pipeline run that is displayed in the Azure UI. (Not the name of the pipeline itself, just the identifier of an individual run of the pipeline.) See the docs.
I still don't know why the pipeline build was working and then suddenly stopped working. It's a little hard to know the exact details of machines running the pipelines and the Android SDK versions being used - maybe that changed....
The text was updated successfully, but these errors were encountered: