FAILURE: Build failed with an exception.
What went wrong: Execution failed for task \':app:lintVitalRelease\'.
Coul
try running flutter clean
on the project folder and then trying again. it seems a file got missing from the build folder
In android build.gradle,
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
didn't work for me and throwed cloud firestore error while executing flutter run. So I changed my gradle version to 4.0.1. where flutter run executed successfully, but flutter build apk fails, so I changed its version to 3.5.4.
In android/gradle/wrapper/gradle-wrapper.properties set,
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
which works perfectly for both flutter run and flutter build apk. In future this gradle version may not support few plugins that we use in our project, in that case upgrade to the next gradle version. refer gradle versions here: How Do I Fix "unexpected element <queries> found in <manifest>"?
I found the workaround I needed for my case, I believe it will work for you as well.
I've set the checkReleaseBuilds
flag to false
in the android's app-level build.gradle
like so:
android {
...
lintOptions {
checkReleaseBuilds false
}
}
Found it here