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 :frowning:
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

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 :wink:
  • 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.

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…