1

if you work with cordova please help me to solve this error from google play :

Upload failed You uploaded a debuggable APK. For security reasons you need to disable debugging before it can be published in Google Play. You uploaded an APK that was signed in debug mode. You need to sign your APK in release mode. You need to use a different package name because "io.cordova.hellocordova" already exists in Google Play.

dbugger
  • 15,868
  • 9
  • 31
  • 33
  • Are you using PhoneGap Build or building locally? – balzafin Feb 23 '15 at 21:07
  • i do everything you say and really thanks but now i got this error message : You uploaded an APK that is not zipaligned. You will need to run a zip align tool on your APK and upload it again – pooya panahandeh Feb 24 '15 at 14:31

3 Answers3

4

Ok, I don't know if you're using PhoneGap Build or building locally, but I'm giving it a shot anyway. So if you are using PhoneGap Build:

You need to use a different package name because "io.cordova.hellocordova" already exists in Google Play.

To fix this error, you need to open your config.xml and change the id of your app from the widget element to something unique. For example "io.cordova.panahandeh":

<widget xmlns     = "http://www.w3.org/ns/widgets"
        xmlns:gap = "http://phonegap.com/ns/1.0"
        id        = "io.cordova.panahandeh"
        version   = "0.0.1">

You uploaded a debuggable APK.

To solve this one, you need to change a setting called Enable debugging from the PhoneGap Builds basic settings. So, on PhoneGap Builds Apps page:

  1. Open your app
  2. Open the settings tab
  3. Uncheck the Enable debugging checkbox
  4. Press Save

If you haven't already digitally signed your app with a certificate, you must also do that before the app can be uploaded to Google Play. You can create a Android Signing key from command line by using Java keytool: http://docs.build.phonegap.com/en_US/signing_signing-android.md.html

After you have created the key, you must upload it to PhoneGap Build before building the app:

  1. From the top right corner click the user icon and select edit account
  2. Open the Signing Keys tab
  3. Under Android press Add key..
  4. Give the key a Title and an Alias, upload the key you earlier created and press Submit key
  5. Unlock the key by pressing the yellow lock icon and giving the the password to your key
  6. Go back to the Apps page and open your app
  7. Under Android, open the drop down where it says No Key Selected and choose your key
  8. Rebuild
balzafin
  • 1,416
  • 1
  • 17
  • 28
1
  1. it seems when you created your project, you didn't specify a package name. When you create your project, you have to run

    cordova create dirname packagename displayname

The packagename must be unique and look like something like this : com.mokshash.test. Look at the doc for more details.

  1. To be able to upload your app to google play, it has to be built in release mode. So when you build the apk you want to upload to google play, you have to run

    cordova build --release android

This will generate an unsigned apk

  1. Final step, you need to sign your app. For that you have to generate a certificate and then sign the app using this certificate. Have a look at this link for detailed steps.
QuickFix
  • 11,661
  • 2
  • 38
  • 50
  • sorry , can you give me more info from generating key , i had problem with it – pooya panahandeh Feb 24 '15 at 14:25
  • Have you followed the steps in the link of ionic framework? Can you explain your problem? – QuickFix Feb 24 '15 at 15:52
  • i do everything accordin the link you gave it to me , but cmd can not recognized keytool – pooya panahandeh Feb 24 '15 at 15:57
  • It's part of java. Maybe you don't have the bin folder of java in your path. You have to find where you installed java and then run for example : `"C:\Program Files\Java\jdk1.7.0_09\bin\keytool"` instead of just keytool. http://stackoverflow.com/questions/5488339/how-can-i-find-and-run-the-keytool – QuickFix Feb 24 '15 at 16:03
  • now my app file in this adress C:\Users\pooya\learner360 then when i make release version i can not upload it becuase googleplay said : You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again. i did every thing step by step from your link , but cmd can not recognize keytool , i install cordova correctly – pooya panahandeh Feb 24 '15 at 16:20
  • keytool is not part of cordova, but part of Java. And now what you're missing is zipalign.exe. zipalign is neither part of cordova, it's part of the android tools. You will find it somewhere where you installed android sdk tools. For me it's in adt-bundle\sdk\build-tools\20.0.0 – QuickFix Feb 24 '15 at 18:10
  • I really sorry but can you tell me what should i do after – pooya panahandeh Feb 24 '15 at 18:34
  • you have to find zipalign.exe in your android sdk installation and then use it to optimise the apk like described in the ionic doc at the end of my answer. – QuickFix Feb 24 '15 at 21:55
0

Check your manifest file.

In the AndroidManifest.xml file, remove

android:debuggable="true"

from the <application> element.

Note: If you manually enable debugging in the manifest file, be sure to disable it in your release build (your published application should usually not be debuggable).

Mokshash
  • 1
  • 1