"Application not installed", is it a bug of ADT?

1.4k views Asked by At

I exported an apk by ADT in eclipse, and I attempted to install this apk into a avd, but it raised "Application not installed".

I checked the logcat, and found this:

W/PackageParser(59): java.lang.SecurityException: META-INF/MANIFEST.MF has invalid digest for res/drawable-mdpi/ic_launcher.png in /data/app/vmdl25264.tmp
E/PackageParser(59): Package com.ep.android has no certificates at entry res/drawable-mdpi/ic_launcher.png; ignoring!

In the file "META-INF/MANIFEST.MF" of the apk, I found this:

Name: res/drawable-mdpi/ic_launcher.png
SHA1-Digest: 4ss2KZ3FzkmfE6HAAsVu0aJKx1U=

So I tried to use my own Java Programming generate a SHA1-Digest for the png file, and the result is "sjmKOs4BYDXg7COdeTc8tIfPBR0=" which is totally different. My Java code for generate a SHA1-Digest is:

public static void main(String[] filename) throws NoSuchAlgorithmException,
        Exception {

    MessageDigest md = MessageDigest.getInstance("SHA1");
    FileInputStream in =  new FileInputStream("./ic_launcher.png");
    int bytes = 0;
    while ((bytes = in.read()) != -1) {
        md.update((byte)bytes);
    }

    in.close();
    byte[] thedigest = md.digest();
    System.out.println(Base64Encoder.encode(thedigest));
}

It seems both the avd and my code consider that the SHA1-Digest in MANIFEST.MF of apk is invalid. So, I guess the SHA1-Digest generator in ADT did something wrong here. Is it a bug? Or I missed something?

0

There are 0 answers