Android SDK Publish fail

Fixed

I didn’t quite understand what you’re trying to do. Are you trying to run Unity app on Android SDK emulator? If so, I don’t think you can run that on it. The best, and the only way to test it is with an Android mobile phone.

Shifty you have to 1st sign your APK inside Unity or via command line with keytool and jarsigner. I think these are stickyed at the top of Android forums.

Make sure you don’t have a Android Debug Cert in your APK or everybody rejects you.

Example of Debug Cert

You can delete these manually.

You should be seeing your Name in the cert with the correct number of years for the cert to expire as set in your keystore.

And when it’s done right

Unity doesn’t store your passwords in the Build Settings so be sure to type in the Keystore password and the Alias Key Password before building…

Working now

Anytime, best of luck to your game.

And for those who like the manual way:

Woops looks like Unity has my keystore that I named store_release.keystore with an alias named store_release

Set up a self signed keystore to expire in like 50 years (18250 days)

In this case I’m going to use a one liner Distinguished Name (No OU given) for my B&N Nook Example with a store_release.keystore store_release for alias

Then sign your APK with the new keystore

Verify it looks good (No Debug keys)

Note Unity does all the Align work for you to pack your game as tight but here is the manual step anyways
(Flag -c is a check remove it to do it for real) You may see an error message if you built with Android Market License that’s ok.

Note adding keys to a APK can be additive so make sure to verify what’s inside from my first posts and delete any DEBUG keys that may be in there from Unity. It’s easy to do it the built-in Unity way just make sure you re-input your passwords inside Unity’s Build Settings every time you reopen your unity project prior to building your app or you may end up with Debug keys again.

All this info can be found HERE.

Sorry I was out eating dinner. I was in similar situation 2 nights ago when I pushed my game out to B N for the 1st time. I’m using a Mac though. Then last night I pushed to Google Play and it was by far the easitest of all the publishers. Apple took me 9 days. B N 1 month and still counting, only pending distribution so I expect any day now.

Although it sounds like you are close to figuring it out. You are not going to get very far without examining the state of your APK.

I am using java 6 on Unity 3.5.6. That’s how it is atm for me so I cannot say if your version of the jdk is having a problem. I don’t know if java 7 is giving issues, there are some people complaining about it and they say to downgrade but I wouldn’t go to that extreme yet without confirming ENV can read / write APKs.

Can you confirm your JAVA_HOME is set from windows CMD? I’m pretty sure unity would error otherwise. On another machine which I have running Windows 7 I noticed my jarsigner was located under C:\Program Files\Java\jdk1.6.0_10\bin\jarsigner.exe That’s still JDK 6 though.

Got to hop online to play with friends soon, Borderlands 2 is calling…

looks good I would select the 32 bit Java bin path only if you haven’t done so already I and would also set the JAVA_HOME path as is minus the bin folder.

Then open a fresh cmd dos window and try to run jarsigner.exe to see if it returns the command flags.

Build as you stated.

Then run the jarsigner.exe -verify -verbose -certs MyGame.apk on the outputted apk to double check before uploading

Absolute legend. I’ll try that now thank you Tomo Games!

Are you sure jarsigner.exe is in your path? Or do you have a typo on the APK’s location.

Try putting it in full quotes. Try being in the folder of where you built your app.

cd "C:\Folder path of your app"
“C:\Program Files\Java\jdk1.6.0_09\bin\jarsigner.exe” -verify -verbose -certs mygamename.apk

Hmm try running it with no flags to see that the flags match, maybe yours is one version too old.

In build settings where you hit the Build Button, not Build and Run, where is your apk being saved ?

Ah it may to verify your publish settings match for the sake of a sanity check…

Like at the top is should say
company name: MyCompanyName
Product name: MyGamesName

Then scroll down to
Other Settings
Build Identifier should match “com.MyCompanyName.MyGamesName”

If you change this build on the device to be sure your ok with it’s new location.

Or simply drag and drop a copy of your APK file to your home directory like C:\Users\tomo in windows 7 and run cmd as you did before.

I did above, posting your jdk path?

does just typing
jarsigner.exe return the command flags?

then do where ever your home path is:
jarsigner.exe -verify -verbose -certs “C:\Users\Shifty\mygamename.apk”

Or if you don’t get the command flags.
cd "C:\Users\Shifty"
“C:\Program Files\Java\jdk1.6.0_09\bin\jarsigner.exe” -verify -verbose -certs mygamename.apk

This is of course assuming your are drag and dropping your APK to that folder.

like by itself you see…

jarsigner.exe
Usage: jarsigner [options] jar-file alias
jarsigner -verify [options] jar-file

[-keystore ] keystore location

[-storepass ] password for keystore integrity

[-storetype ] keystore type

if not then try
“C:\Program Files\Java\jdk1.6.0_09\bin\jarsigner.exe”
Usage: jarsigner [options] jar-file alias
jarsigner -verify [options] jar-file

[-keystore ] keystore location

[-storepass ] password for keystore integrity

[-storetype ] keystore type

So what is your output?

It’s 5am over here. I got to head to bed ask for help in the Unity3D chat channel. Your issue can’t be worse than these dos tips. Probably better to take a break and resume with a fresh look, re-read the trail it will make better sense what to type once you have your apk filename path.

I sent you a PM, I am having the same problem here:

“Google Play requires that the certificate used to sign the apk be valid until at least October 22, 2033. Create a new certificate.”

I have no idea what is causing this. Any help is appreciated.

@Tomo Games.

Can you kindly explain why UNITY Publishing settings’ Keystore cannot be use and need to key gen through keytool by jdk?
I am so mess up to the procedure to publish a apk to Google Play now.
Please gaive a hand.

THX
Yan