Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: Why is Release Build debuggable?

I've been trying for hours to generate a release build with Android Studio that is not debuggable so that I can upload it to Google Play. But sadly this is not working. When I try to upload the apk I get the following error:

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

This is not a duplicate. I have tried everything suggested in related questions...

Update

I have decoded the generated apk. The BuildConfig.class looks like this:

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

So the build type is actually release and debug is set to false!

But inside the AndroidManifest.xml, gradle has put

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

Debuggable is set to true! How come!?

like image 886
sjkm Avatar asked Feb 11 '26 15:02

sjkm


1 Answers

I could finally find the reason and solve the issue!

The reason was that I had library modules referenced which had an AndroidManifest.xml with debuggable="true" tag present. I have changed those to "false" and it works now!

I have no idea why Android Studio chooses this "info" over the gradle settings... Anyway I'm very glad that it works now!

like image 141
sjkm Avatar answered Feb 13 '26 17:02

sjkm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!