簡體   English   中英

在 Android Studio 中生成簽名 APK 時出現 Gradle 錯誤

[英]Gradle error when generating signed APK in Android Studio

我是 Android Studio 的新手。 我的構建成功編譯,直到我嘗試生成簽名的 APK。 這是我當前的 build.gradle 文件:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.1.1"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我查看了以前的 Stack Overflow 答案,他們都建議將 google() 存儲庫放在首位,我已經這樣做了。 我也嘗試將“com.android.tools.lint:lint-gradle:27.1.1”添加到依賴項部分,但這沒有奏效。

Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all files for configuration ':app:lintClassPath'.
   > Could not resolve com.android.tools.lint:lint-gradle:27.1.1.
     Required by:
         project :app
      > Could not resolve com.android.tools.lint:lint-gradle:27.1.1.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/27.1.1/lint-gradle-27.1.1.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/27.1.1/lint-gradle-27.1.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve com.android.tools.lint:lint-gradle:27.1.1.

任何幫助表示贊賞!

如果您沒有主動檢查項目,那么禁用它可能會更容易。

android {
...
  lintOptions {
      checkReleaseBuilds false
  }

}

該代碼應阻止該特定 gradle 任務運行。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM