Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android apks are built debuggable #929

Closed
xiscoj opened this issue Feb 12, 2019 · 68 comments
Closed

Android apks are built debuggable #929

xiscoj opened this issue Feb 12, 2019 · 68 comments

Comments

@xiscoj
Copy link

xiscoj commented Feb 12, 2019

When upload to Google Play says
Upload failed
You uploaded a debuggable APK or Android App Bundle. For security reasons you need to disable debugging before it can be published in Google Play. Find out more about debuggable APKs or Android App Bundles.

You uploaded an APK that is not signed with the upload certificate. You must use the same certificate. The upload certificate has fingerprint:
....

There are other users reporting same behaviour on gdevelop forums.
I dissasembled apk with apktool and indeed, androidmanifest.xml contains a debuggable=true section.
Happened once some days ago, but know happened more than 10 times

@ghost
Copy link

ghost commented Feb 13, 2019

Might need to recompile it manually on Android Studio and generate a signed one. Else would be nice to add it into game properties too like the same as admob id.

@xiscoj
Copy link
Author

xiscoj commented Feb 13, 2019

I'm struggling with Android Studio no luck until now. I've found a web where they say to add --release option to cordova on compilation.

@xiscoj
Copy link
Author

xiscoj commented Feb 15, 2019

hi still compiling debuggable apks

@Baylissimo
Copy link

Just happened to me too today. Was adding my final version of my app to Play Store and it isn't letting me submit. Trying to work out what to do now.

@Baylissimo
Copy link

Baylissimo commented Feb 18, 2019

Is this what we need to do? In conjunction with making our own keystore, etc.?

Build for android platform in release mode with specified signing parameters:

cordova build android --release -- --keystore="..\android.keystore" --storePassword=android --alias=mykey

from
[https://cordova.apache.org/docs/en/latest/reference/cordova-cli/]

@xiscoj
Copy link
Author

xiscoj commented Feb 18, 2019

hi,
yes I think it is the problem is that we need to contact google to reset upload key and send them te new generated key. I think 4ian could solve this by 2 methods (maybe i'm wrong):
1.- add --release to the build options
2.- Allow us to download the key used to compile
Here is how to do option 2
http://cauldron.pt/pt/lost-keystore-how-to-generate-and-register-a-new-upload-key-mac/
I'm working on it :-(

@Baylissimo
Copy link

This won't help with a simple solution for Gdevelop or for people who already have apps published on the store. But just letting you know for restarting, I unpublished and renamed my app on the play console and started from scratch. Used Cordova command line to build Android project. Opened it in Android Studio. A few hours of updating and learning later, I have bundled builds for the play store with all the necessary keys and certificates. And uploaded a second apk to make sure it is accepting it.

@Baylissimo
Copy link

From Android Studio you have to generate signed bundle or apk to avoid debuggable error code.

@4ian
Copy link
Owner

4ian commented Feb 18, 2019

Sorry for the bad user experience here! I'll try to add releases build for next version.
Otherwise, going manually with Cordova/Android studio is the way to go. We could document this on the wiki.

@Baylissimo
Copy link

Thanks Florian. All good. Going to bed now but I'll try and write it up a bit more clearly and concisely tomorrow at work, if that helps.

I'm so happy I got it working. Sending the link to my internal testers now.

@xiscoj
Copy link
Author

xiscoj commented Feb 18, 2019

hi,
google contacted me with instructions to generate new key, now I'n fighting with android studio and cordova to generate a signed apk waiting for your document @Baylissimo

@zatsme
Copy link
Contributor

zatsme commented Feb 18, 2019

Not sure if this will help... 🤔

https://stackoverflow.com/questions/10930331/how-to-sign-an-already-compiled-apk

You will have to remove from playstore and start from scratch as the signature will be different.

@zatsme
Copy link
Contributor

zatsme commented Feb 18, 2019

@4ian Going forward, could the online service could accept keystore parameters from the gui and sign the APK with release flags 😁

@xiscoj
Copy link
Author

xiscoj commented Feb 18, 2019

@zatsme the problem here is that we don't have the key to sign apks.
It gdevelop could accept our key it would be great

@zatsme
Copy link
Contributor

zatsme commented Feb 18, 2019

@zatsme the problem here is that we don't have the key to sign apks.
It gdevelop could accept our key it would be great

Did you look at the link? You can unpack the apk, sign it yourself and then upload to Google. If that's not your problem then I don't understand the problem 😞

@Baylissimo
Copy link

Hi @zatsme. Have you tried it? I think the issue is signing the apk after it has already been submitted. That's why I shelved my first release and just recreated it with a proper keystore etc. via cordova and Android Studio.

@Baylissimo
Copy link

Here's the walkthrough of my process. Very rambly and nooby (I'm still getting my head around everything.) But it seems to work. @xiscoj Here it is. Ask me anything.
ExportAsCordovaProject (2).pdf

@Baylissimo
Copy link

I'm starting to think that I may just be able to go from Gdevelop to Android Studio without using Cordova in the middle. Shows how much of a noob I am.

@xiscoj
Copy link
Author

xiscoj commented Feb 19, 2019

@zatsme the problem here is that we don't have the key to sign apks.
It gdevelop could accept our key it would be great

Did you look at the link? You can unpack the apk, sign it yourself and then upload to Google. If that's not your problem then I don't understand the problem disappointed

hi,
the problem is that we don't have the key to sign because google generates it from the first apk you upload and it was generated by gdevelop. Thats the problem. Now I've generated my own key and will give google my public key so will be able to sign myself.
My problem is that when I compile with cordova admob doesn't work if gdevelop compiles it works

@xiscoj
Copy link
Author

xiscoj commented Feb 19, 2019

Here's the walkthrough of my process. Very rambly and nooby (I'm still getting my head around everything.) But it seems to work. @xiscoj Here it is. Ask me anything.
ExportAsCordovaProject (2).pdf

thanks @Baylissimo , it pretty much what I've done, the problem as said for me is admob doesn't show with manual compilation :(
I think before android studio can read the project you have to build once with cordova and before signing andorid studio also need to build once. It is also possbile to build a signed apk with cordova
Create a file in your platforms/android/ directory with the name release-signing.properties .
Put the following content into the file
storeFile=YourApp.keystore
storeType=jks
keyAlias=yourapp
keyPassword=YOUR-KEY-PASSWORD
storePassword=YOUR-STORE-PASSWORD
Extracted from here
https://haensel.pro/apache-cordova/cordova-create-a-signed-release-apk-easy-howto

@Baylissimo
Copy link

Ah, yes. Thanks @xiscoj
So many complex parts. It's good for me to learn though.

Sorry, I missed the part about admob with manual compilation. Hope you get it sorted.

@LudicrousExplosion
Copy link

@4ian Thanks for your reaction. 👍

I'm having this problem since februari 8. I'm surprised it has anything to do with Gdevelop itself, it looks like a build server configuration cause.

I currently don't have the time to dive into doing it manually with Cordova/Android studio
(and I'm not sure if I want to learn this manual compiling, I was very pleased with my Indie subscription).

So I just have to wait for the update. Is there a planned date?

Fedor

my game: Santa, Penguin Hunter
https://play.google.com/store/apps/details?id=tid.games.santapenguinhunter

@Marichalazo
Copy link

I bought an indie subscription for the ease of publishing apps. But the issue has become too complicated. We need a solution. I've been building the app for 2 months every day and I can not publish it for this inconvenience. I'm not a programmer, that's why I chose your program.

@xiscoj
Copy link
Author

xiscoj commented Feb 25, 2019

hi there,
here is my solution to this problem, mantaining the app on google play store. Here are some of the needed programs
here
GoogleSignApp.pdf

@Marichalazo
Copy link

You say literally: "mantaining the app on google play store", but I could not upload the application because GooglePlay tells me that the application is debuggable. Will they give me the signature even if the app is not in Google Play?

Pd: Sorry for my english.

@xiscoj
Copy link
Author

xiscoj commented Feb 25, 2019

sorry I used the wrong word I mean without deleting your app from google Play as I thin @Baylissimo did.
Sorry about my englidh too

@4ian
Copy link
Owner

4ian commented Feb 25, 2019

I've just tested and was able to upload an APK built from GDevelop without any issue:

image

This is because I explictly opted out from Android App Bundle:

image

Can you all confirm if you done this or not? If you not done this, you won't see Disabled. Instead you will see Enabled.

I have enabled Google managing the "app signing key", what to do?

If this is the case, two solutions:

  • Easiest: Erase your application (if you've not published it) and create a new one. This time, click on Opt Out. Submit your APK and it should work:

    screenshot 2019-02-25 22 00 41
  • Harder: Otherwise, you must edit your APK to disable debuggable and to re-sign it with a new upload key. as explain here by @xiscoj

    • Later, you must always do these steps to submit an update.

Will GDevelop be compatible with the new "Android App Bundle" (i.e: automatic signing by Google)

Surely later, but it's a bit more complicated because this means that GDevelop would have to generate a unique key pair for each game (at least the first time it's uploaded), and sign the APK with this key.
Nothing impossible, but there are tons of things to do and it's still a bit tricky - and decompiling APK and recompiling is always an alternative.

How to avoid other users having this issue?

I've updated the wiki page to make this more obvious that opt out must be chosen.

I'm sure it's not my problem

In this case, please comment here and send screenshots so that we're extra sure what the issue is.

@Baylissimo
Copy link

Baylissimo commented Feb 25, 2019 via email

@Baylissimo
Copy link

Baylissimo commented Feb 25, 2019 via email

@4ian
Copy link
Owner

4ian commented Feb 25, 2019

This is a first attempt at uploading. Once you have an APK successfully uploaded, you must now upload other APK like the first one. Be sure to increase the version number (1.0.0 -> 1.0.1 -> 1.0.2 or 1.1, 1.1.1, 1.1.2... etc) otherwise the play store will reject an APK that has the same version as an existing one.

@Baylissimo
Copy link

Baylissimo commented Feb 26, 2019 via email

@Marichalazo
Copy link

But have you decompiled and set the debugging attribute to false?

@Marichalazo
Copy link

I did it with one-button export

@Baylissimo
Copy link

Baylissimo commented Feb 26, 2019 via email

@Baylissimo
Copy link

Baylissimo commented Feb 26, 2019 via email

@Marichalazo
Copy link

I tried it without putting the debug in false and I did not get it. He told me that the app was debuggable. That's why I easily decompile it with Apk Easy Tool and compile it again.

@Baylissimo
Copy link

Baylissimo commented Feb 26, 2019 via email

@Marichalazo
Copy link

I had to decompile it to put the debuggable in "false" in the manifest.xml. Then I compiled it again and that's it. I had my apk file with my own keys and in publish mode

@Marichalazo
Copy link

I'm sorry if I do not explain myself well. I am Spanish and my English level is not very good.

@Baylissimo
Copy link

Baylissimo commented Feb 26, 2019 via email

@Baylissimo
Copy link

Baylissimo commented Feb 26, 2019 via email

@4ian
Copy link
Owner

4ian commented Feb 26, 2019

Can you please post a screenshot of the error?

@4ian, you are saying that even with opting out of Google signing keys you
must still decompile and change debug option?

No. When opt-ing out I was able to upload my APK without any error and without decompiling.

@Baylissimo
Copy link

Baylissimo commented Feb 26, 2019 via email

@Baylissimo
Copy link

Baylissimo commented Feb 26, 2019 via email

@4ian
Copy link
Owner

4ian commented Feb 26, 2019

We can't see it, please post instead on GitHub directly: #929
Also prefer to edit your message rather than posting a new one to keep the discussion shorter ;)

@Baylissimo
Copy link

Baylissimo commented Feb 26, 2019 via email

Repository owner deleted a comment from Baylissimo Feb 26, 2019
@4ian
Copy link
Owner

4ian commented Feb 26, 2019

Latest version. Yeah please upload them from your computer. :) You can also edit from your computer.

@Baylissimo
Copy link

Ok. About to sleep, but went in and tried again. Here's what Google says:
screen shot 2019-02-26 at 9 45 57 pm

@zatsme
Copy link
Contributor

zatsme commented Feb 26, 2019

Is this a second app in your account and might that be the difference with 4ian? Not clear from the conversation? Can you have two apps with same debug key? 🤔

@Baylissimo
Copy link

It's more than the second app on my account. Can we only have one?

@Baylissimo
Copy link

Baylissimo commented Feb 26, 2019

@zatsme Just checked at https://support.google.com/googleplay/android-developer/answer/7384423?hl=en

And shouldn't be a problem.

From above link: "Accepting the Terms of Service does not mean that all apps associated with your developer account will automatically be enrolled in app signing."

@4ian
Copy link
Owner

4ian commented Feb 26, 2019

Think I've found the issue. Some workers doing the compilation to APK did not have signing activated. So you would have a debug APK. Sorry about this!

During my tests, I must have had signed APK by luck.

So give it another try (sorry about this!):

  • Package your game as usual with GDevelop
  • Upload (make sure to not choose Google app signing as I explained.

That should work :)

@Baylissimo
Copy link

Baylissimo commented Feb 26, 2019

Ha! Oh boy. Just tried it and it worked.
Thanks @4ian

Off to sleep. Will make more apps and take over the world tomorrow.

Night!

@4ian
Copy link
Owner

4ian commented Feb 26, 2019

Off to sleep. Will make more apps and take over the world tomorrow.

Sounds like a good plan :)
Glad it works, thanks for testing!

For your interest this happened because:

  • There have been a bug where workers that are doing the packaging got stuck for some reason. I added extra safety for this.
  • When fixing this, I forgot to activate signing on new workers. I added reminders to ensure this is not forgotten (should a bug happen again).

@4ian
Copy link
Owner

4ian commented Feb 26, 2019

Closing as @Baylissimo confirmed it's working for him.

@xiscoj, @vavedev @Marichalazo @LudicrousExplosion and others: please retry now, it should work :) Be sure not to choose the Google app signing (I've updated the wiki page to explictly say that you have to opt out).

@4ian 4ian closed this as completed Feb 26, 2019
@4ian
Copy link
Owner

4ian commented Feb 26, 2019

Workers are partially based on AWS yeah!

@xiscoj
Copy link
Author

xiscoj commented Feb 26, 2019

Yes you do. All versions compiled from gdevelop until 22th February had debuggable "true" I don't know if something changed from that day.
Then you have to compile and sign again, check at my pdf some posts above.
Bye

So for clarity, beacause there are a few things going on in this thread. @4ian, you are saying that even with opting out of Google signing keys you must still decompile and change debug option?

On Tuesday, February 26, 2019, Michael Bayliss @.> wrote: It's all good. I just thought @4ian said the one button export wa s working so I got excited. And the apk tool is only windows so I just have to use the longer workflow. grin On Tuesday, February 26, 2019, Marichalazo @.> wrote: > I'm sorry if I do not explain myself well. I am Spanish and my English > level is not very good. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <#929 (comment)>, or mute > the thread > https://github.com/notifications/unsubscribe-auth/AOoZIGy5xDtuFdd4l9lSVuTf2BPcBvB7ks5vROebgaJpZM4a3eNx > . >

@LudicrousExplosion
Copy link

Thank you all for solving this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants