Android APK Rejections / Upload Errors with Google Play & Amazon App Store.
We have traced down issues with uploading to the Google Play & Amazon App Stores to how GameSalad Creator signs APKs.
Creator uses jarsigner, which is a tool provided by Java and used in Android 4.2 (API 17) and earlier.
Google has since release a newer tool called apksigner which does some things differently. Up until now, jarsigner was fine, but Google Play & the Amazon App Store will no longer accept apks signed with jarsigner.
Until we update Creator, you will need to sign manually using the command line.
For macOS, if you have Android Studio installed you can do the following:
- Download the apk with the Download button on publishing.
- Open Terminal
- Run the following command (replacing <things in> as needed)
~/Library/Android/sdk/build-tools/28.0.3/zipalign -v 4 <downloaded apk> <downloaded apk>_zipaligned.apk ~/Library/Android/sdk/build-tools/28.0.3/apksigner sign --ks <your keystore file> --in <downloaded apk>_zipaligned.apk --out <whateveryouwantotnameyourapk>.apk
That final APK <whateveryouwantotnameyourapk>.apk is what you upload to Google Play.
Your build tools may not be in build-tools/28.0.3. The number will change depending on when you installed Android Studio and which build tools version you chose to install after.
If you need help finding zipalign and apksigner try:
find ~/Library/Android/sdk -name apksigner
That should show the correct file path (possibly more than one, just use the one with the highest number).
For Window, the commands will be:
C:\Users\{user}\AppData\Local\Android\Sdk\build-tools\<build tools version>\zipalign.exe -v 4 <downloaded apk> <downloaded apk>_zipaligned.apk C:\Users\{user}\AppData\Local\Android\Sdk\build-tools\<build tools version>\apksigner.bat sign --ks <your keystore file> --in <downloaded apk>_zipaligned.apk --out <whateveryouwantotnameyourapk>.apk
We will update this thread once we find a better solution to this problem (either updating the tools, building a solution for online signing, or both).
Comments
I appreciate the clear instructions for how to work-around this issue.
Thank you very much for your efforts and instructions @adent42
Awesome, thanks @adent42.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
It didn't work for me. I am so exhausted and angry. Pls help?
The things in the pointy brackets <these ones> need to be replaced with your own game's name etc.
Would become
etc.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Thank you so much for your help Armelline. I tired but it did not work. I think I should wait until @adent42 update the new creator.
Thank you
Obviously you need to are inside the folder were are located the "command tools" so in the terminal write CD to change directory and go inside the right directory but if the error persist try to put: "./" before digit command, for example:
./zipalign -v 4 myapp.apk myapp_zipaligned.apk
./apksigner sign --ks yourkeystore.keystore --in myapp_zipaligned.apk --out myapp.apk
I've put in the same directory all files, keystore and unsigned apk.
✮My Web Site✮ ✮My Full Games On Sale✮ ✮Follow Me✮ ✮My Video Channel✮ ✮Contact Me To Buy My GS Games✮
Thanks pinkio i tired it said No such file or directory . When are you planning to solve this issue @adent42 ?
Just wondered which components of Android Studio we actually need for apk signing
Are you guys downloading the whole lot including legacy SDKs etc or just the build tools?
It's a massive download as previously I just grabbed the files I needed for Android publishing from GS web link and it didn't include all SDKs etc.
I still struggle to understand exactly what's needed and why during apk signing. If anyone could explain it to me I'd really appreciate it as I've tried to find a simple explanation but to no avail.
@cagrisavan it's going to take a while since we'll want to solve it for both Mac and Windows and the windows build is going take a bit. I will say that even if you have the update, you will still need to know where apksigner is (as we'll be pointing to the Google provided tools).
So let's solve this here so you can get going and not have to wait.
So things to check first:
1) Have you installed Android Studio? https://developer.android.com/studio
2) Have you installed Android SDK Build tools? Here are some instructions: https://developer.android.com/studio/intro/update#sdk-manager
3) Okay, now that you have build tools, try to find apksigner.
Let us know how the steps go (I'm making this troubleshooting session public to help other people in the same predicament. If you need some more real-time help and you're in a time-zone near CDT, then you can also chat with our team on the support chat box.
Make a dir with all objects that you need to sign the app.
1) i've just download the 28.0.3 tools.
2) i've put the unsigned.apk app and my keystore in the same directory where are all command tools.
3) after i just launch the terminal and follow the @adent42 instructions.
✮My Web Site✮ ✮My Full Games On Sale✮ ✮Follow Me✮ ✮My Video Channel✮ ✮Contact Me To Buy My GS Games✮
Also, if you don't want Android Studio, you can just directly download the tools here:
https://androidsdkmanager.azurewebsites.net/Buildtools.
You can then unzip them and you'll know where everything is.
@cagrisavan you need to are inside a dir where are located all command tools
So open your terminal and write cd "your directory"
for example i've download the 28.0.3 dir in my desktop so i write in the terminal:
cd desktop
after
cd android-9
and after i write the command line tools:
zipaligned
and after
apksigner.
Honestly i've spend a 2 hours before to sign my apk apps because i need to update my java sdk but now the process is really simple.
Anyway i hope that GS fix the process soon as possible.
✮My Web Site✮ ✮My Full Games On Sale✮ ✮Follow Me✮ ✮My Video Channel✮ ✮Contact Me To Buy My GS Games✮
I finally got it!
1º I have downloaded and installed Android Studio (https://developer.android.com/studio)
2nd I have updated it (Android Studio> Check for Updates)
3rd I have copied the two files (the signed apk downloaded from gamesalad and the *.keystore) to the same build-tools folder.
4th I have copy-pasted and executed the command in Terminal, but I had problems there, since every time I tried, I got the same error: the directory did not exist. So I have checked that the path is correct (using: find ~ / Library / Android / sdk -name apksigner)
5th Once the path and names of my files are correct ... everything has worked. The NEW file generated (*. apk_zipaligned.apk) has been perfectly supported by Google Play Console
@adent42 today i've generated two android games with RC but the musics files in the apk are not present!
i think that probably the .m4a music files are missed in the build process...
could you please check this issue?
Thanks.
✮My Web Site✮ ✮My Full Games On Sale✮ ✮Follow Me✮ ✮My Video Channel✮ ✮Contact Me To Buy My GS Games✮
I tried the steps today on Windows,
Put both my unsigned apk and keystore file in the build-tool folder.
input first command in terminal, but it says "unable to open 'nameofmyapp' as zip archive
What am I doing wrong?
Hi, I just did everything but still got "(No such file or directory)"
this is my code:
~/Library/Android/sdk/build-tools/29.0.3/zipalign -v 4 quizpro.apk quizpro_zipaligned.apk
~/Library/Android/sdk/build-tools/29.0.3/apksigner sign --ks quizpro.keystore --in quizpro_zipaligned.apk --out quizprogame.apk
don't know what to do...
thanks!
@fruitjuiceproductions.mb it looks very close. Whenever you insert your file info (quizpro.apk) to replace <these>, drag it into terminal. It should show the whole path to the file (Users/etc/etc/quizpro.apk). Then whenever you create your zipaligned.apk or your final .apk, make sure you have it going to same directory (Users/etc/etc/yournewfile). Do it in 2 steps, run command to create zipaligned.apk, then run 2nd command to sign. Make sure to drag your keystore into terminal also. It works, but it was tricky for a non techie like me. Hope this helps you
@fruitjuiceproductions.mb 29.0.3 might not be the correct directory. Use the "find" command above and it should help you. If it does not, make sure you have installed Android Studio and build tools. If you don't want to download android studio, you can download just the build tools in the link i post above and then you will know where the tools are when you unzip them.
Sorry for double post, I can't to edit my previous one to add the command.
I tried this command in terminal but got unable to open as zip archive
C:\Users\Indra Aziz>AppData\Local\Android\Sdk\build-tools\29.0.3\zipalign.exe -v 4 Kordi_Ukulele_unsigned Kordi_Ukulele_unsigned_zipaligned.apk
Unable to open 'Kordi_Ukulele_unsigned' as zip archive
The downloaded unsigned apk is in the the build tool folder
@adent42 hi about music issue ok now it works thank you!
✮My Web Site✮ ✮My Full Games On Sale✮ ✮Follow Me✮ ✮My Video Channel✮ ✮Contact Me To Buy My GS Games✮
@weaselpopgames2020 thank you! finally made it draging all the files in the terminal, thank you so much!
Might be other issues, but at a minimum it should be:
C:\Users\Indra Aziz>AppData\Local\Android\Sdk\build-tools\29.0.3\zipalign.exe -v 4 Kordi_Ukulele_unsigned.apk Kordi_Ukulele_unsigned_zipaligned.apk
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@indra.aziz
are you in the directory with the APK file (probably the download directory).
If not, then the command might not quite be right. This might work:
C:\Users\Indra Aziz\AppData\Local\Android\Sdk\build-tools\29.0.3\zipalign.exe -v 4 C:\Users\Indra Aziz\Downloads\Kordi_Ukulele_unsigned.apk C:\Users\Indra Aziz\Downloads\Kordi_Ukulele_unsigned_zipaligned.apk
The idea is, if you didn't change directories after opening the CMD window, then the file isn't there to process. You need to put the path to the file wherever it is on the drive OR change directories there. I assume the CMD shell default is your home dir so you'll need to cd Downloads (or wherever you downloaded the file).
Quick video showing you how to sign. Mac focused.
https://www.youtube.com/watch?v=jy5ndat-kVU
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
And here's a super crude super quick AppleScript application that'll do the legwork for you. Be sure zipalign and apksigner are in the same directory. It'll name exported files with the date and time, and if you get your keystore password wrong it'll just fail with a wall of text. I accept no responsibility for anything that happens as a result of use of this app.
This is the source so you can compile it youself if you want to be sure it isn't stealing your passwords. Been yonks since I did any Applescript so hopefully it's not too cringeworthy...
https://pastebin.com/b5JQCELT
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Thank you @adent42 @Armelline
The first command worked I think, but the second one didn't work for me it says failed to load signer, and cannot find the keystore. Here is the screen of the cmd.
I have the keystore file in both the downloads folder and the build-tools folder.
Thanks for creating this @Armelline . Really helpful. 👍️
It's looking for the keystore in the folder C:\Users\Indra Aziz\ since you didn't tell it to look elsewhere. Either give it the path to the keystore, or put the keystore in that folder (as that's where you're running the command from). Same goes for the unsigned apk.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
After 7 days of messing with this, i think i've given up. I finally got the first command to work, and then received the same error message "failed to load signer". Every command was put in properly and everything was in the same folder. Any ballpark figure of when the GS tool will be updated? Thanks