9

as you know apk is a zip archive, I extracted it and replaced some resources, and zipped it again, when I install it, I get this exception

java.lang.SecurityException: META-INF/MANIFEST.MF has invalid digest

any solution for this error??

JustMe
  • 279
  • 6
  • 14
  • [here](http://asantoso.wordpress.com/2009/09/15/how-to-build-android-application-package-apk-from-the-command-line-using-the-sdk-tools-continuously-integrated-using-cruisecontrol/) is APK build process. It may help. – sudmong May 28 '11 at 13:39

3 Answers3

26

I came across this same error caused by having installed the JDK 7 instead of 6. Hope it helps some other people with this error.

Ross Hambrick
  • 5,880
  • 2
  • 43
  • 34
  • 23
    If you're signing yourself with jarsigner and have JDK 7 you can add the options "-digestalg SHA1 -sigalg MD5withRSA" to the jarsigner command and it will work with JDK7. – gravitron Feb 04 '12 at 15:12
  • gravitron - Thanks for the informational and helpful comment! This is a better answer since you don't have to downgrade your SDK – MitziMeow Mar 03 '13 at 04:42
  • Great comment, gravitron! It helped. – SpongeBobFan Apr 19 '13 at 14:33
5

Did you sign it after re-packing it? Changing anything in it broke the existing signature.

If the package is already installed and you re-sign the new one with a different signing key, it will also refuse to install.

mah
  • 39,056
  • 9
  • 76
  • 93
1

My problem was wrong certificate alias in keystore. I changed it to "CERT" and it started to work. I used this command: keytool -changealias -alias "1" -destalias "CERT" -keystore android.jks

Jarda Pavlíček
  • 1,636
  • 17
  • 16