java - 在 Android Studio v3.1.1 中生成构建 apk 时如何修复 checkReleaseBuilds false

标签 java android android-studio-3.0

我在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/

相关文章:

android - 当我从不同的 Activity 显示时,为什么我的 DialogFragment 样式是错误的?

android - 如何在单个选项卡中处理具有多个 Activity 的 android tabHost 选项卡

java - 在 Ubuntu 上打开项目时 Android Studio 卡住

xml - 无法在 webview Android 应用程序中打开 pdf

java - 静态字段和单例的问题

android - Webview 没有正确显示 Html

java - Subclipse 如何覆盖更改的文件

Android studio 3.0 Canary 6 执行 com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction 时发生故障

java - 如何在jms上支持事务/故障转移?

java - 使用 Java 的表达式求解器算法