when I am signing the apk, I get \"jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 463 but got 465 bytes)\" this error mes
You definitely are able to sign an already signed apk multiple times using different keys:
Note that you can sign an APK multiple times with different keys.
E.g. I accomplished to sign a Debug-Apk with the release key so that I was able to test upgrades of released versions. Also, I was able to sign an already released apk with the debug key for reproducing bugs.
This is what you should do
.apk file to .zip.zip file and remove the META-INF folder.apk jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 \
-keystore my-release-key.keystore my_application.apk alias_name
For the debug key, the alias should be androiddebugkey and the password android. The debug keystore is per default $HOME/.android/debug.keystore. See also Signing in Debug Mode.