Java 如何修复任务';的执行失败:app:lintVitalRelease&x27;

Java 如何修复任务';的执行失败:app:lintVitalRelease&x27;,java,android,Java,Android,当我在Android应用程序上签名时,会出现以下错误: 任务执行失败:app:lintVitalRelease。 >无法解析配置“:app:lintClassPath”的所有文件。 >找不到lint-gradle-27.1.0.jar(com.android.tools.lint:lint-gradle:27.1.0)。 在以下位置搜索: https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/27.1

当我在Android应用程序上签名时,会出现以下错误:

任务执行失败:app:lintVitalRelease。 >无法解析配置“:app:lintClassPath”的所有文件。 >找不到lint-gradle-27.1.0.jar(com.android.tools.lint:lint-gradle:27.1.0)。 在以下位置搜索: https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/27.1.0/lint-gradle-27.1.0.jar >找不到lint-27.1.0.jar(com.android.tools.lint:lint:27.1.0)。 在以下位置搜索: https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint/27.1.0/lint-27.1.0.jar >找不到lint-checks-27.1.0.jar(com.android.tools.lint:lint-checks:27.1.0)。 在以下位置搜索: https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-checks/27.1.0/lint-checks-27.1.0.jar >找不到lint-api-27.1.0.jar(com.android.tools.lint:lint-api:27.1.0)。 在以下位置搜索: https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-api/27.1.0/lint-api-27.1.0.jar >找不到intellij-core-27.1.0.jar(com.android.tools.external.com intellij:intellij-core:27.1.0)。 在以下位置搜索: https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/27.1.0/intellij-core-27.1.0.jar 在以下位置搜索: https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2-proto/4.1.0-alpha01-6193524/aapt2-proto-4.1.0-alpha01-6193524.jar 可能的解决办法: -声明提供工件的存储库,请参阅https://docs.gradle.org/current/userguide/declaring_repositories.html 当我将此添加到我的应用程序时:

lintOptions {
    quiet true
    // Whether lint should set the exit code of the process if errors are found
    abortOnError false
    // Returns whether lint will only check for errors (ignoring warnings)
    ignoreWarnings true
    // Returns whether lint should check for fatal errors during release builds. Default is true.
    // If issues with severity "fatal" are found, the release build is aborted.
    checkReleaseBuilds false
}

然后没有错误,但APK不会安装在我的手机上。

我正好遇到了您的问题:

  • 退出Android Studio
  • 删除位于
    C:\Users\{USER}\.gradle\caches
  • 运行Android Studio并重建

    • 我也有这个问题!我刚刚删除了这些文件:

      project_folder/.gradle
      project_folder/.idea
      project_folder/.gradle
      project_folder/build
      project_folder/app/build
      project_folder/app/release
      C:\\users\Your_Name\.gradle\caches
      

      然后打开Android Studio并再次执行。

      找到解决方案吗?