Page 1 of 1

Package file was not signed correctly

Posted: Thu Dec 05, 2013 6:40 am
by kingdavid
Hi guys,
I've just created an android app (apk min 2.2 frojo) and I upload it on play store: all ok from the market.
But when I install my app it's shown this message (Package file was not signed correctly ) .

I think I ve generated correctly my keystore and integrate it during the standalone building. The export process went ok.

Some of you can help me in this?

Thanks in andvace...

Bye

Re: Package file was not signed correctly

Posted: Thu Dec 05, 2013 9:55 am
by kingdavid
Googling on the net I found this interesting article:
Signing Android APK using JDK 7
I've stumbled upon really annoying and hard to inspect problem when publishing an APK to Google Play. Building the package went well as usual, uploading to Google Play as well but in the end user wasn't able to download and install the application getting error message: "Package file was not signed correctly.".

That was strange as Google is veryfing packages just after upload - if the package was built in release mode etc. so I would expect Google to show at least some warning. But it acted like everything was in the best order.

The problem was I was using JDK 7! Default digest algorithm for Java 7 is SHA-256 instead of SHA-1 used in JDK 6. As Android APKs have to use SHA-1 to compute checksums for included files, default JDK 7 settings made resulting APK unusable. I think Google should check this in it's post-upload process.

To resolve this issue add the following lines to build.xml forcing the digest algorithm to be SHA-1.

Code: Select all

<presetdef name="signjar">
    <signjar digestalg="SHA1" sigalg="MD5withRSA">
    </signjar>
</presetdef>
Do you think its possible to automatize this operation inside exporting process in livecode?

Re: Package file was not signed correctly

Posted: Thu Dec 05, 2013 8:54 pm
by jacque
I think RR would welcome a bug report about this.

Re: Package file was not signed correctly

Posted: Sun Mar 30, 2014 2:43 pm
by Joe Kot
Running into the same issue with windows 7 and jdk7. Where is the build.xml located to add the code. Will I need to use eclipse to change the build.xml. - Thanks Joe

Re: Package file was not signed correctly

Posted: Sun Mar 30, 2014 7:29 pm
by newtronsols
To get this to work:
I had to build my standalone Android app apk file - without signing.
I had to create a private key - using the keytools.exe [I built a Livecode Windows app - to test various possibilities & understand]
Used jarsigner.exe to build my signed apk [similarly I built a Livecode Windows app -to test various possibilities & understand]
Used zipalign.exe to align the apk for Google Play to accept.

keytools.exe and jarsigner.exe are is in your Java... sub-folder.
You can access via start, cmd
Similarly zipalign.exe is in your .android .... sub-folder.

It took me a week to get to grips with it properly - lots of web/Forum searching.

Re: Package file was not signed correctly

Posted: Tue Apr 08, 2014 12:05 pm
by MaxV