Ok so I am coming back to an Android project I haven’t messed with in a year and a new install of Unity on a new machine. After getting past a number of other problems, I now have it building to the phone but right after it installs the APK, I get this error:
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
I have googled this and people are talking about making sure you have deleted old packages and what not. I have done this and has made no difference.
I have also tried creating a new keystore and still no go.
At my wit’s end at the moment and would appreciate any help. Also I have tried running this:
jarsigner -verify -verbose -certs mypackage.apk
It says:
jar verified.
Warning:
This jar contains entries whose certificate chain is not validated.
Edit: I just checked some other packages that I made awhile ago and get the same output, and they still install just fine, so I guess that’s normal.
Here’s what appears to be the relevant lines from the logcat:
W/PackageParser( 96): Exception reading assets/bin/Data/Managed/Assembly-CSharp-firstpass.dll in /mnt/asec/smdl2tmp1/pkg.apk
W/PackageParser( 96): java.lang.SecurityException: META-INF/BOWQUEST.SF has invalid digest for assets/bin/Data/Managed/Assembly-CSharp.dll in /mnt/asec/smdl2tmp1/pkg.apk
W/PackageParser( 96): at java.util.jar.JarVerifier.invalidDigest(JarVerifier.java:130)
W/PackageParser( 96): at java.util.jar.JarVerifier.verifyCertificate(JarVerifier.java:357)
W/PackageParser( 96): at java.util.jar.JarVerifier.readCertificates(JarVerifier.java:265)
W/PackageParser( 96): at java.util.jar.JarFile.getInputStream(JarFile.java:389)
W/PackageParser( 96): at android.content.pm.PackageParser.loadCertificates(PackageParser.java:342)
W/PackageParser( 96): at android.content.pm.PackageParser.collectCertificates(PackageParser.java:513)
W/PackageParser( 96): at com.android.server.PackageManagerService.installPackageLI(PackageManagerService.java:5802)
W/PackageParser( 96): at com.android.server.PackageManagerService.access$2200(PackageManagerService.java:137)
W/PackageParser( 96): at com.android.server.PackageManagerService$5.run(PackageManagerService.java:4566)
W/PackageParser( 96): at android.os.Handler.handleCallback(Handler.java:587)
W/PackageParser( 96): at android.os.Handler.dispatchMessage(Handler.java:92)
W/PackageParser( 96): at android.os.Looper.loop(Looper.java:130)
W/PackageParser( 96): at android.os.HandlerThread.run(HandlerThread.java:60)
E/PackageParser( 96): Package com.fizzpow.BowQuestPM2 has no certificates at entry assets/bin/Data/Managed/Assembly-CSharp-firstpass.dll; ignoring!
GRRRR, I just figured this out. JDK 7, Don’t USE IT! =) I downgraded to JDK 6 and this fixed the issue along with another issue I was having implementing the TapJoy plugin. Someone should probably look into why JDK 7 breaks stuff since I am sure I won’t be the only one that decides to just download the latest version on a re-install.
My case was especially bad, since I didn’t know what the “expected behavior” was for trying to install a certified app locally, and I thought that the “certification failed” error I was getting was normal!
I also realized why OSX users would not run into this very easily, JDK 6 is pre-installed by the OS. Pretty handy when I was working on my Mac the other day.
I had this JDK7 signing problem with BD-J jars (which also use self-signed certificates) - adding the root certificate as trusted CA to the certificate store solved the problem (keytool -importcert -trustcacerts -file root.crt …).
problem apparently fixed – I again uninstalled JDK alltogether, and reinstalled 6 – things look ok, submitting to market now and crossing fingers.
So I was having the signing problem, and downgrading to JDK6 did fix it – and jarsigner now properly verifies the file.
But unfortunately, I am still unable to install the app. When I download it off my server, it fails to install. When using Unity to Build Run, I’m getting this INSTALL_PARSE_FAILED_NO_CERTIFICATES
I’m unable to sign the app directly using keytool/jarsigner because unity signs it with the debug certificate and there’s a byte count mismatch.
48 hours and counting – any thoughts are appreciated