Android Studio:为什么 Release Build 是可调试的?

Android Studio: Why is Release Build debuggable?

我已经尝试了几个小时来使用 Android Studio 生成一个 不可调试 的发布版本,以便我可以将其上传到 Google玩。但遗憾的是,这是行不通的。当我尝试上传 apk 时出现以下错误:

You uploaded a debuggable APK. For security reasons you need to disable debugging before it can be published in Google Play

这不是重复的。我已经尝试了相关问题中建议的所有内容...

更新

我已经解码生成的 apk。 BuildConfig.class 看起来像这样:

public final class BuildConfig
{
  public static final String APPLICATION_ID = "com.myapplication.packagename";
  public static final String BUILD_TYPE = "release";
  public static final boolean DEBUG = false;
  public static final String FLAVOR = "";
  public static final int VERSION_CODE = 2;
  public static final String VERSION_NAME = "1.0.1";
}

所以构建类型实际上是 release 并且 debug 设置为 false!

但是里面AndroidManifest.xml,gradle已经放

<application android:debuggable="true"...

可调试设置为 true!怎么会!?

终于找到原因解决问题了!

原因是 我引用了库模块,其中有一个 AndroidManifest.xml 带有 debuggable="true" 标签。我已将它们更改为 "false",现在可以使用了!

我不知道为什么 Android Studio 选择这个 "info" 而不是 gradle 设置...无论如何我很高兴它现在可以工作了!