Reputation: 278
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)
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
Upvotes: 5
Views: 5279
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
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