After building a game and testing it in debug mode, I've tried building the game and signing it for use on the market. The game seems to be signed without issue, and the market even lets me upload and publish it.
However, Android devices refuse to install it. I've tested using several devices, and this has me very puzzled. Especially considering the Android Market sees the APK as being signed and allows it be uploaded and even published/purchased. (Had a friend confirm this on his account).
I've tried all of the following :
Using the following tools:
Any ideas or suggestions would be very appreciated.
Below is the result of running jarsigner -verify -verbose on the APK:
s 2719 Sun Oct 09 22:49:14 CDT 2011 META-INF/MANIFEST.MF
sm 14336 Sun Oct 09 22:49:08 CDT 2011 assets/bin/Data/Managed/Assembly-UnityScript.dll
sm 125440 Sun Oct 09 22:49:08 CDT 2011 assets/bin/Data/Managed/Boo.Lang.dll
sm 292864 Sun Oct 09 22:49:08 CDT 2011 assets/bin/Data/Managed/Mono.Security.dll
sm 1068544 Sun Oct 09 22:49:10 CDT 2011 assets/bin/Data/Managed/System.dll
sm 444416 Sun Oct 09 22:49:10 CDT 2011 assets/bin/Data/Managed/UnityEngine.dll
sm 2495488 Sun Oct 09 22:49:10 CDT 2011 assets/bin/Data/Managed/mscorlib.dll
sm 3023 Sun Oct 09 22:49:10 CDT 2011 assets/bin/Data/level0
sm 1231 Sun Oct 09 22:49:10 CDT 2011 assets/bin/Data/level1
sm 1191 Sun Oct 09 22:49:10 CDT 2011 assets/bin/Data/level2
sm 10865 Sun Oct 09 22:49:10 CDT 2011 assets/bin/Data/mainData
sm 150 Sun Oct 09 22:49:10 CDT 2011 assets/bin/Data/settings.xml
sm 3126951 Sun Oct 09 22:49:10 CDT 2011 assets/bin/Data/sharedassets0.assets
sm 350261 Sun Oct 09 22:49:12 CDT 2011 assets/bin/Data/sharedassets1.assets
sm 515 Sun Oct 09 22:49:12 CDT 2011 assets/bin/Data/sharedassets2.assets
sm 515 Sun Oct 09 22:49:12 CDT 2011 assets/bin/Data/sharedassets3.assets
sm 20863 Tue Sep 13 13:53:10 CDT 2011 assets/bin/Data/splash.png
sm 2246019 Sun Oct 09 22:49:12 CDT 2011 assets/bin/Data/unity default resources
sm 3743444 Sun Oct 09 22:49:12 CDT 2011 assets/libs/armeabi-v7a/libmono.so
sm 6286608 Sun Oct 09 22:49:12 CDT 2011 assets/libs/armeabi-v7a/libunity.so
sm 89832 Tue Sep 13 14:01:20 CDT 2011 classes.dex
sm 3483 Sun Oct 09 22:49:04 CDT 2011 res/drawable/app_icon.png
sm 3440 Sun Oct 09 22:49:14 CDT 2011 AndroidManifest.xml
sm 920 Sun Oct 09 22:49:04 CDT 2011 resources.arsc
sm 6563 Sun Oct 09 22:49:04 CDT 2011 res/drawable-hdpi/app_icon.png
sm 98120 Tue Sep 13 14:01:22 CDT 2011 lib/armeabi-v7a/libmono.so
sm 56240 Tue Sep 13 14:01:22 CDT 2011 lib/armeabi-v7a/libunity.so
s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope
Warning: This jar contains entries whose certificate chain is not validated.
You should run logcat (android sdk folder, plattform tools typically, there is an adb.exe. Then do Start > Run > cmd.exe > switch to that folder and type "adb.exe logcat"). Of course you have to enable "USB Debugging" too in your Android phone.
Once logcat is started, open Market and download your game and pause logcat after the download fails and look there.
It's probably not a problem with signing but one that your game is to big for your phones cache (i.e. HTC Desire only has 40 MB where some big chunk is already used by the OS and you typically get ~25 MB). Since HTC Desire uses the /cache partition for downloads (market downloads too), it can't download (and install) games which are bigger than the free space there.
If that's the issue, you should be able to identify it via logcat, as Market (Vending) will display such errors in logcat
edit: There is also another thing which could cause problems on developer devices: When you push the game with Unity3d on the phone you, most developers push the version which is signed with the android debug key. This works for development. But once the game is released, it's signed with the retail key.
The problem is: You can only install or "upgrade" versions which have identical signatures. So if your developer version is still installed on your phone, you must uninstall it first, before you're able to install it from the market.
Go to Settings > Applications > Manage Applications and select your game and hit uninstall. This will remove the game completely from your device (also any saved data) and delete all the private folders in the internal memory. Now you should be able to install it from the market.
The reason for this is: Android uses the signatures to make sure that the game or it's update is coming from the developer who initially published it. So if the signature is changed (i.e. signed by a different key), Android will refuse to update it.
That being said, you should backup your signature key very carefully, because if you lose it once, you will never be able to release any updates to your existing game (you would have to change it's package name and add it as a new entry. All existing users won't get notified about updates until they download the new version... of course they lose all progress)
edit2: With the error message from your latest comments, I found this one
Seem as you have to uninstall JDK 1.7 and use 1.6 instead.
1.) Make sure the jdk\bin path is in the Windows Environment Variable PATH. (Both 32 & 64 bit paths for good measure)
2.) Close and reopen Unity
3.) Create a brand new keystore file from scratch. Make sure your password is 100% correct
I had the same problem and that worked for me. I would also zipalign your .apk once its been built and signed. Let me know if you need help with that.
answered Oct 10, 2011 at 06:08 AM
Argh, OK. Closer, but still not there.
If I get different results with the paths reversed I'll update, but if you have any other ideas to try please let me know.
s k 2719 Mon Oct 10 17:13:08 CDT 2011 META-INF/MANIFEST.MF
smk 14336 Mon Oct 10 17:13:02 CDT 2011 assets/bin/Data/Managed/Assembly-UnityScript.dll
smk 125440 Mon Oct 10 17:13:02 CDT 2011 assets/bin/Data/Managed/Boo.Lang.dll
smk 292864 Mon Oct 10 17:13:02 CDT 2011 assets/bin/Data/Managed/Mono.Security.dll
smk 1068544 Mon Oct 10 17:13:02 CDT 2011 assets/bin/Data/Managed/System.dll
smk 444416 Mon Oct 10 17:13:02 CDT 2011 assets/bin/Data/Managed/UnityEngine.dll
smk 2495488 Mon Oct 10 17:13:02 CDT 2011 assets/bin/Data/Managed/mscorlib.dll
smk 4719 Mon Oct 10 17:13:04 CDT 2011 assets/bin/Data/level0
smk 3065 Mon Oct 10 17:13:04 CDT 2011 assets/bin/Data/level1
smk 1189 Mon Oct 10 17:13:04 CDT 2011 assets/bin/Data/level2
smk 7387 Mon Oct 10 17:13:04 CDT 2011 assets/bin/Data/mainData
smk 150 Mon Oct 10 17:13:04 CDT 2011 assets/bin/Data/settings.xml
smk 396143 Mon Oct 10 17:13:04 CDT 2011 assets/bin/Data/sharedassets0.assets
smk 3081057 Mon Oct 10 17:13:04 CDT 2011 assets/bin/Data/sharedassets1.assets
smk 350295 Mon Oct 10 17:13:04 CDT 2011 assets/bin/Data/sharedassets2.assets
smk 473 Mon Oct 10 17:13:04 CDT 2011 assets/bin/Data/sharedassets3.assets
smk 20863 Tue Sep 13 13:53:10 CDT 2011 assets/bin/Data/splash.png
smk 2246019 Mon Oct 10 17:13:04 CDT 2011 assets/bin/Data/unity default resources
smk 3743444 Mon Oct 10 17:13:04 CDT 2011 assets/libs/armeabi-v7a/libmono.so
smk 6286608 Mon Oct 10 17:13:06 CDT 2011 assets/libs/armeabi-v7a/libunity.so
smk 89832 Tue Sep 13 14:01:20 CDT 2011 classes.dex
smk 3483 Mon Oct 10 17:12:58 CDT 2011 res/drawable/app_icon.png
smk 3440 Mon Oct 10 17:13:06 CDT 2011 AndroidManifest.xml
smk 920 Mon Oct 10 17:12:58 CDT 2011 resources.arsc
smk 6563 Mon Oct 10 17:12:58 CDT 2011 res/drawable-hdpi/app_icon.png
s = signature was verified m = entry is listed in manifest k = at least one certificate was found in keystore i = at least one certificate was found in identity scope
answered Oct 10, 2011 at 10:23 PM
DO NOT USE JDK 1.7.0 EVER.
Seems that was the problem, when I changed to JDK 1.6 the universe stabilized and sanity returned. Thanks everyone. I really hope this helps someone else out there.
answered Oct 11, 2011 at 06:41 PM