java - 如何修复任务 ':app:lintVitalRelease'的执行失败

标签 java android

当我签署我的 Android 应用程序时,它会出现此错误:

Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all files for configuration ':app:lintClassPath'.
   > Could not find lint-gradle-27.1.0.jar (com.android.tools.lint:lint-gradle:27.1.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/27.1.0/lint-gradle-27.1.0.jar
   > Could not find lint-27.1.0.jar (com.android.tools.lint:lint:27.1.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint/27.1.0/lint-27.1.0.jar
   > Could not find lint-checks-27.1.0.jar (com.android.tools.lint:lint-checks:27.1.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-checks/27.1.0/lint-checks-27.1.0.jar
   > Could not find lint-api-27.1.0.jar (com.android.tools.lint:lint-api:27.1.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-api/27.1.0/lint-api-27.1.0.jar
   > Could not find intellij-core-27.1.0.jar (com.android.tools.external.com-intellij:intellij-core:27.1.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/27.1.0/intellij-core-27.1.0.jar
   
     Searched in the following locations:
         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

Possible solution:
 - Declare repository providing the artifact, see the documentation at 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 的 gradle 缓存文件夹
  • 运行 Android Studio 并重建
  • 关于java - 如何修复任务 ':app:lintVitalRelease'的执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65868280/

    相关文章:

    java - 如何在 Android Imageview 中将 xml 中的一种颜色替换为另一种颜色(从黑到白)?

    android - 通过 Intent.ACTION_WIRELESS_SETTING 查看无线设置后应用程序关闭后退按钮

    java - 对 JTable 使用 ResultSetTableModel 有什么好处?

    java - 无法在 Mac OS X 上通过 jinfo 启用 DTrace 探测

    java - Jedis是否支持异步操作

    java - 在 Dropwizard 应用程序中将自定义数据传递给 Hibernate Envers

    java - 如何连接 int 值而不添加它们? ( java )

    java - 恢复 Activity - NullPointerException

    android - 从数据库中获取值并将其显示在android中的TextView中

    android - AccountManager 不在 Android N 预览中添加自定义帐户