5

I am getting this error when running 'flutter run --release' in the terminal. I am looking if someone can give suggestion to resolve this issue. I tried many solutions found in internet, but it did not word. Thanks.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:lintVitalRelease'.

Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'. Failed to transform libs.jar to match attributes {artifactType=processed-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. > Execution failed for JetifyTransform: C:\Users\mn\AndroidStudioProjects\myport\build\app\intermediates\flutter\debug\libs.jar. > Transform's input file does not exist: C:\Users\mn\AndroidStudioProjects\myport\build\app\intermediates\flutter\debug\libs.jar. (See https://issuetracker.google.com/iss ues/158753935)

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 49s Running Gradle task 'assembleRelease'... Running Gradle task 'assembleRelease'... Done 110.5s Exception: Gradle task assembleRelease failed with exit code 1

Vincent
  • 208
  • 3
  • 10

3 Answers3

2

You should be able to fix this by upgrading your version of gradle to at least 7.2

Kindly confirm if updating your gradle-wrapper.properties and build.gradle to the following resolves the issue.

in gradle-wrapper.properties update your distributionUrl to

distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip

and in android/build.gradle change the gradle version from 4.1.0 to

classpath 'com.android.tools.build:gradle:7.1.2'
Nisha Jain
  • 637
  • 6
  • 14
1

Just add these lines to your android>app>build.gradle

android {

compileSdkVersion 28

lintOptions {

    disable 'InvalidPackage'
    //Put the following line
    checkReleaseBuilds false
    //abortOnError false
}
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
0

Just follow the steps in this link: I run First: flutter build apk --debug Then: flutter build apk --profile In the end: flutter build apk --release

Vincent
  • 208
  • 3
  • 10