我在Android studio v3.1.1中开发了一个Android应用程序。
我的项目已完成,我想从 Build -> Generate Build Apk 中生成 apk,但第二次后在 Logcat
中显示以下错误:
Lint found fatal errors while assembling a release target.
To proceed, either fix the issues identified by lint, or modify your build script as follows:
...
android {
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
...
我该如何解决这个问题?请帮助我
最佳答案
在应用的 build.gradle
中添加以下 lintOptions
block 。
android {
defaultConfig {
...
}
buildTypes {
...
}
lintOptions {
// Returns whether lint should be quiet (for example, not write informational messages such as paths to report files written)
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
}
}
关于java - 在 Android Studio v3.1.1 中生成构建 apk 时如何修复 checkReleaseBuilds false,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49968650/