我尝试在谷歌播放上上传我的apk,遇到了一个错误消息:“你上传了一个可调试的apk。出于安全原因,您需要在谷歌播放中发布调试之前禁用调试。了解更多关于可调试apk的信息。”

然后我在我的manifest中写了android:debuggable="false",然后再试一次。我遇到了同样的错误,所以我已经从我的模块中设置了构建变体,并尝试再次生成apk,但这一次,生成了这个错误:

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

当前回答

在我的案例中,问题与谷歌Play所要求的最低目标API级别有关。它被设定为小于26。

当我将最低目标API级别设置为26时,问题消失了。

其他回答

我遇到了这个问题,并通过添加以下内容来解决:

lintOptions { 

    checkReleaseBuilds false

}

以我的身材。android{}部分中的Gradle文件。

确保在所有string.xml文件中定义了所有的翻译

我的问题是缺少翻译。我有一个settings.xml没有被翻译,因为它是不需要的,所以我必须添加"translatable="false"到字符串:

<string translatable="false" name="stringname">This string doesn't need translation</string>

你可以从gradle build选项卡中找到更多信息:

2022年编辑:

点击大象按钮就可以跑了:

gradle assembleDebug

我在从android工作室创建签名apk时也遇到了同样的问题。我只是在构建上做了一点点改变。android{}内的Gradle文件

lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }