简体   繁体   English

Android Studio v3.1.1 生成 build apk 时如何修复 checkReleaseBuilds false

[英]How to fix checkReleaseBuilds false when generate build apk in Android Studio v3.1.1

I develop one android application in Android studio v3.1.1 .我在Android studio v3.1.1 中开发了一个 android 应用程序。
My project has finished and I want generate apk from Build -> Generate Build Apk but after second show me below error in Logcat :我的项目已经完成,我想从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
    }
}
...

How can I fix it?我该如何解决? Please help me请帮帮我

Add the following lintOptions block in your app's build.gradle .在应用的build.gradle添加以下lintOptions块。

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
    }
}

The message you've been given tells you everything you need to know.您收到的消息会告诉您需要知道的一切。 Either fix the lint errors that are causing this message (check the documentation here to see how to run lint and where to find the full report with details), or add checkReleaseBuilds false to the lintOptions block in your build.gradle file.修复导致此消息的 lint 错误(查看此处的文档以了解如何运行 lint 以及在哪里可以找到包含详细信息的完整报告),或者将checkReleaseBuilds false添加到 build.gradle 文件中的lintOptions块。

Add the following lintOptions block in your app's build.gradle在应用的 build.gradle 中添加以下 lintOptions 块

 lintOptions {
        checkReleaseBuilds false
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM