Google Play says my APK built with Android Studio Build->Generate Signed APK is debuggable
Asked Answered
M

5

9

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.

Meritocracy answered 4/1, 2014 at 15:53 Comment(1)
Did you disable debugging in your manifest?Horbal
V
20

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.

Variolous answered 4/1, 2014 at 21:21 Comment(3)
Where exactly do you make this change?Bosanquet
it is inside the module's build.gradle file, debug and release are the default build types included in each project created/imported in Android Studio.Variolous
got it thanks-- I thought I opened up everything. Missed that oneBosanquet
H
11

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"
Horbal answered 4/1, 2014 at 16:0 Comment(2)
@zyngawow It looks like for some versions of Android Studio you must explicitly define it. Not sure why.Horbal
Not applicable when using Gradle.Wilona
F
4

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.

Firecracker answered 4/1, 2014 at 16:6 Comment(0)
W
0

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.

Wilona answered 25/4, 2014 at 15:35 Comment(0)
A
0

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.

Anthropophagite answered 11/9, 2015 at 17:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.