简体   繁体   中英

Execution failed for task ':app:lintVitalRelease' flutter file picker

I'm using flutter file picker plugin which requires an upgraded gradle. So I upgraded my gradle, as shown below.

Project-gradle

buildscript {
ext.kotlin_version = '1.3.50'
repositories {
    google()
    jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:4.0.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
   }
}

App-Gradle

compileSdkVersion 29


    defaultConfig {
    applicationId "****"
    minSdkVersion 16
    targetSdkVersion 29
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

Gradle-Wrapper

#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

THE ERROR

* 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: B:\*directory*\build\app\intermediates\flutter\debug\libs.jar.

This works in debug mode, but for the release appbundle or apk, I get this error

go to android/app/build.gradle

lintOptions {
    disable 'InvalidPackage'
    checkReleaseBuilds false <- add this
}

flutter clean and this should solve the problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM