- Home /
Building for Android
Hey Everyone,
Having a lot of trouble building my app for the android.
I have been able to build an APK file and have it installed on my tablet and phone. I have created a marketplace accound and have uploaded an APK to it (Not a development build). I could see it on the market place and had a friend download it to see if it works.
It didn't work :( The error was something to do with signing.
I don't really understand the signing and keystore stuff in the publishers section of the build. I was hoping someone could help me with this step. If I can get the proper APK file made then I'm laughing!
How do I sign the APK? DO I even have to? does unity do it for me by default? What is this keystore thing? DO I need to worry about it?
Thanks guys. Been looking this up and I can't find a clear answer. Thanks guys
Answer by Bunny83 · Feb 22, 2013 at 01:03 AM
The keystore is a signature file that is used to sign your apk. When you create development builds Unity will not sign the apk.
You only need one Keystore file for your projects. The file is your signature. To create one do this:
In the publishing settings check the "Create New Keystore" box.
Click browse and choose a location where you want to store the file. It should be somewhere central since it's not really related to your project.
Set a protection password for the file and confirm it.
Select "Create a new key" from the "Key Alias" dropdown.
A window should open which you have to fill with your personal data about your organisation / person. The alias at the top is just a name of the keystore. If you have multiple identities make sure you choose a meaningful name. You need to set a keystore password. Note this is not the same as the protection password above. As far as i know they can be the same, but for security you should use two different. If you haven't write the passwords onto a sheet of paper ;)
Click "Create Key" to generate your keystore file.
To use a keystore for signing you have to:
Check the "Use Existing Keystore" box.
Click browse and select your keystore file.
enter your protection key.
select your desired identity from the alias dropdown.
enter the alias password in the field below
Make sure you have set your Android Market Licensing RSA Public Key at the bottom of the publishing settings. The public key has to be acquired from your Google market account.Now create your APK file and it will be signed with your identity.
Note: You can create multiple Keys / Identities in one Keystore file. The first protection password will protect the file itself. When you select an identity from the file in the alias dropdown you have to type in the password for the identity.
ps: For more insight into the signing why you need it and how it works see this well-written page on android.com
hi, Bunny83. i am using unity 4.0. i find your answer most helpful. except for the part about the Android $$anonymous$$arket Licensing RSA Public $$anonymous$$ey. i cannot find it at the buttom of the publishing settings. it only has the "split application binary" checkbox. is it located somewhere else? or is there something else that i need to do?
Thanks!
Well, it seems they removed the field because it seems it had no actual function ;)
http://answers.unity3d.com/questions/311117/how-does-unity-use-the-android-market-licensing-lv.html
thanks so much! it worked! hehehe btw, if you want to see the game, this is the link: https://play.google.com/store/apps/details?id=com.Fractaldev.Shooter1&feature=search_result#?t=W251bGws$$anonymous$$SwyLDEsImNvbS5GcmFjdGFsZGV2LlNob290ZXIxIl0.
thanks again! ^_^
Answer by Lenvanthis012 · Aug 20, 2015 at 09:42 PM
I am using Unity 5. For me, making a new keystore from Unity didn't work.
From unity, you build with the option "Google Android Project". Then from Android Studio, open the project. And From the build menu, "clean the project". Then "Generated Signed Apk" in the build menu lead to the successful release build.
A long painful process to figure.... Ughh....
How did it not work? (Player Settings -> Publishing Settings of Android) 1- Press create new keystore button 2- Select a directory and a name for yourkeystore 3-Enter a keystore password 4-Confirm your password 5-Click on Unsigned (debugkey) 6-Click on Create new key selection under the Unsigned 7-Create your key. Enter a password for that specific key. (NOT THE $$anonymous$$EYSTORE) 8-Now you will have a keystore, which is exactly what it sounds like. It stores keys. The key you created is also part of it, since it's a storage file of keys. 9- Go to your JD$$anonymous$$ file. Usually something like C:\Program Files\Java\jdk_1.x.xxx\bin\ 10- Use the keytool utility to sign your keys and get a SHA-1 certificate which you will plug in for the Oauth2 Client ID, during the authorization process of your app, in Google Play Store Services. 11- Open a cmd file and change directory to jdk1.x....\bin\ file where keytool resides. 12- type keytool -exportcert -v -list -alias -keystore 13-It will ask for the password which you entered for the Alias during Step 7. Enter it again 14- You will get your certification. Among them will be the SHA-1 Certificate. Copy paste it to the Play Store Services page. 15- You've made it !