Lint found fatal errors while assembling a release target

错误信息:

调试的时候,都没有问题,但是在打包的时候,报出下面的错误

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

分析

提示中,关闭lint checkReleaseBuilds 的检查,虽然这样可以解决问题,但是没有解决根本问题。也就是说隐患依旧会存在

lint 是代码检查,可以优化代码,发现一些潜在的bug,所以尽量不要关闭

关于lint的使用,可以查看 Android 性能优化:使用 Lint 优化代码、去除多余资源
解决方法:

这个错误报告会生成在 [app module]/build/reports/lint-results-yourBuildName-fatal.html 打开这个网页,可以看到详细的错误信息,修改起来就简单了。

下面贴上我这次遇到的具体情况,图中写的很清楚了,就不在叙述了。找到原因后,就可以从根本上解决

参考:
Error when generate signed apk
---------------------
作者:薛瑄
来源:CSDN
原文:https://blog.csdn.net/xx326664162/article/details/81779475

猜你喜欢

转载自blog.csdn.net/Liuqz2009/article/details/88949199