Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to disable debugging to upload the apk

When I try to upload my app in Google Play I get this error.

Upload failed

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 compile my app with Android Studio 0.4.0

I tried to set this in my Manifest.xml - Android:debuggable="false" , but nothing happened. When I tried to set this <option name="SOURCE_GEN_TASK_NAME" value="generateReleaseSources" /> in .iml file, and again nothing.

I tried and with this in build.gradle,and again nothing.

android {
    signingConfigs {
        debug {
            storeFile file("horoskopSms.jks")
            storePassword "1q2w3e"
            keyAlias "horoskopSms"
            keyPassword "1q2w3e"
        }
    }
}

My.iml file

<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE"    type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
  <configuration>
    <option name="SELECTED_BUILD_VARIANT" value="debug" />
    <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
    <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugJava" />
    <option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
    <option name="SOURCE_GEN_TASK_NAME" value="generateReleaseSources" />
    <option name="ALLOW_USER_CONFIGURATION" value="false" />
    <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
    <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
    <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
    <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
    <option name="APK_PATH" value="/build/apk/HoroskopSms-debug-unaligned.apk" />
  </configuration>
</facet>
     <facet type="android-gradle" name="Android-Gradle">
     <configuration>
     <option name="GRADLE_PROJECT_PATH" value=":HoroskopSms" />
  </configuration>
</facet>
  </component>
           <component name="NewModuleRootManager" inherit-compiler-output="false">
        <output url="file://$MODULE_DIR$/build/classes/debug" />
      <exclude-output />
     <content url="file://$MODULE_DIR$">
   <sourceFolder url="file://$MODULE_DIR$/build/source/r/debug" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/build/source/aidl/debug" isTestSource="false" />

<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/debug"         isTestSource="false" />
 <sourceFolder url="file://$MODULE_DIR$/build/source/rs/debug" isTestSource="false" />
     <sourceFolder url="file://$MODULE_DIR$/build/res/rs/debug" type="java-resource" />
  <sourceFolder url="file://$MODULE_DIR$/build/source/r/test/debug" isTestSource="true" />
  <sourceFolder url="file://$MODULE_DIR$/build/source/aidl/test/debug" isTestSource="true" />
  <sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/test/debug" isTestSource="true" />
  <sourceFolder url="file://$MODULE_DIR$/build/source/rs/test/debug" isTestSource="true" />
  <sourceFolder url="file://$MODULE_DIR$/build/res/rs/test/debug" type="java-test-resource" />
  <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
  <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
  <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/src/main/assets" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
  <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
  <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
  <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/aidl" isTestSource="true" />
  <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/assets" isTestSource="true" />
  <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/java" isTestSource="true" />
  <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/jni" isTestSource="true" />
  <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/rs" isTestSource="true" />
  <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/res" type="java-test-resource" />
  <sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/resources" type="java-test-resource" />
  <excludeFolder url="file://$MODULE_DIR$/build/apk" />
  <excludeFolder url="file://$MODULE_DIR$/build/assets" />
  <excludeFolder url="file://$MODULE_DIR$/build/bundles" />
  <excludeFolder url="file://$MODULE_DIR$/build/classes" />
  <excludeFolder url="file://$MODULE_DIR$/build/dependency-cache" />
  <excludeFolder url="file://$MODULE_DIR$/build/incremental" />
  <excludeFolder url="file://$MODULE_DIR$/build/libs" />
  <excludeFolder url="file://$MODULE_DIR$/build/manifests" />
  <excludeFolder url="file://$MODULE_DIR$/build/res" />
  <excludeFolder url="file://$MODULE_DIR$/build/symbols" />
  <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-v4-19.0.0" level="project" />
<orderEntry type="library" exported="" name="ComAndroidSupportAppcompatV71900.aar" level="project" />
<orderEntry type="library" exported="" name="FortumoInApp-android-9.1.0" level="project" />
</component>
       </module>
like image 464
cross_flame Avatar asked Dec 20 '13 15:12

cross_flame


People also ask

What is a Debuggable APK?

Android allows the attribute android:debuggable to be set to true in the manifest, so that the app can be debugged. By default this attribute is disabled, i.e., it is set to false , but it may be set to true to help with debugging during development of the app.

How do I enable debug on APK?

To start debugging an APK, click Profile or debug APK from the Android Studio Welcome screen. Or, if you already have a project open, click File > Profile or Debug APK from the menu bar. In the next dialog window, select the APK you want to import into Android Studio and click OK.

How do I debug an app from Google Play?

Attach the debugger to a running appClick Attach debugger to Android process . In the Choose Process dialog, select the process you want to attach the debugger to. If you're using an emulator or a rooted device, you can check Show all processes to see all processes.


2 Answers

I found a solution in Android Studio, I go to "Build variants" and change it from debbug to release.

like image 75
cross_flame Avatar answered Nov 09 '22 02:11

cross_flame


There's a debuggable property you can set in a build type in your build.gradle file; that will supersede any setting in your manifest. You haven't done anything there, have you? The debuggable property of your release build should already be false.

Which build are you trying to upload to Google Play? If you're uploading the debug build, then that's your problem -- upload the release build instead.

like image 38
Scott Barta Avatar answered Nov 09 '22 02:11

Scott Barta