生成签名的 apk 时出现“:app:lintVitalRelease"错误 [英] ':app:lintVitalRelease' error when generating signed apk

查看:25
本文介绍了生成签名的 apk 时出现“:app:lintVitalRelease"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 google play 上上传我的 apk 并遇到错误消息:您上传了一个可调试的 APK.出于安全原因,您需要先禁用调试,然后才能在 Google Play 中发布.详细了解可调试的 APK."

I've tried to upload my apk on google play and encountered an error message: "You uploaded a debuggable APK. For security reasons you need to disable debugging before it can be published in Google Play. Learn more about debuggable APKs."

然后我在清单中写了 android:debuggable="false" 并再次尝试.我遇到了同样的错误,因此我将模块中的构建变体设置为 release 并尝试再次生成 apk,但这一次,生成了此错误:

Then I wrote android:debuggable="false" in my manifest and tried again. I've encountered the same error, so I've set the build variant from my module to release and tried generated an apk again, but this time, this error is generated:

Error:Gradle: Execution failed for task ':app:lintVitalRelease'.
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 检查,它们存在是有原因的.相反,检查错误是什么并修复它.

I wouldn't recommend turning off the lint checks, they're there for a reason. Instead, check what the error is and fix it.

错误报告保存到[app module]/build/reports/lint-results-yourBuildName-fatal.html.您可以在浏览器中打开此文件以了解错误信息.

The error report is saved to [app module]/build/reports/lint-results-yourBuildName-fatal.html. You can open this file in a browser to read about the errors.

如果 Gradle 能让错误报告的生成位置更清楚一点就好了.

It would be nice if Gradle could make it a little more clear where the error report is generated.

这篇关于生成签名的 apk 时出现“:app:lintVitalRelease"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆