Vincent
Vincent

Reputation: 278

Execution failed for task ':app:lintVitalRelease'. > Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'

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.

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)

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

Upvotes: 5

Views: 5279

Answers (3)

Mirza Ammar Baig
Mirza Ammar Baig

Reputation: 11

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

android {

compileSdkVersion 28

lintOptions {

    disable 'InvalidPackage'
    //Put the following line
    checkReleaseBuilds false
    //abortOnError false
}

Upvotes: 1

Nisha Jain
Nisha Jain

Reputation: 757

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'

Upvotes: 2

Vincent
Vincent

Reputation: 278

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

Upvotes: 0

Related Questions