Question

I get the 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.

I generate my APK with Android Studio, Build->Generate Signed APK. I created a Keystore.

Was it helpful?

Solution

With a powerful gradle build system in android studio you can do it without even touching your code. You can also make your debug build with debuggable false to test what differences are

  buildTypes {

      debug {
         runProguard false/true
         proguardFile getDefaultProguardFile('proguard-android.txt')
         debuggable false/true

      }

      release {
         runProguard true/false
         proguardFile getDefaultProguardFile('proguard-android.txt')
         debuggable false/true

      }
  }

Power of Gradle.

Note : You wont be able to see the process in the left pane of DDMS under device info even the application running in device, if it has debuggable false in build configuration.

OTHER TIPS

If you have the tag android:debuggable="true" in your application manifest, or if you don't have it in, try changing it/putting this in your application manifest tag:

 android:debuggable="false"

Check DEBUG value in BuildConfig.java file in gen folder. Sometime if we are not doing clean build this value remains true.

Best is to do a clean release build.

If you're using Gradle (As you should) set the debug and release variables, then go to your build variables tab and select release flavor. Build the project, and if you set everything up correctly, your apk should be in the build/apk folder of your project.

I was having this same problem. Anymore, android:debuggable in the manifest file is deprecated if you are using Android Studio; you shouldn't have it there. The problem in my case was that the system was incorporating debug versions of some component classes, which did not get rebuilt (as I assumed they would) when I switched from doing debug to release builds. Everything worked once I selected (from the menus) Build->Clean Project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top