1

I made apk by apportable and try to upload apk to android market.

At first when I uploaded the apk says

Upload failed
You uploaded an APK with invalid or missing signing information for some of its files. You need to create a valid signed APK. Learn more about signing.

That's OK. I should sign the apk, so I signed and uploaded

jarsigner -keystore android.keystore -verbose myApk.apk myalias

then market shows this error.

Upload failed
You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again.

That's OK too. I must zipalign the apk.

zipalign -f 4 myApk.apk myAlignedApk.apk

now I uploaded again, but the first error(missing signing) happens again!!

I think I should do signing -> zipaligning

This procedure is correct.

How can I fix or solve this problem?


Thanks to you

I could investigate the problem deeply.

There is something wrong with signing not zipaligning

sign normally or with -digestalg SHA1

$ jarsigner -keystore android.keystore -verbose myApk.apk myAlias

or

$ jarsigner -keystore android.keystore -digestalg SHA1 -verbose myApk.apk myAlias

it shows the error

$ jarsigner -verify animalparade-release.apk

jarsigner: java.lang.SecurityException: invalid SHA1 signature file digest for assets/se_maoudamashii_magical24.caf

However, sign like this ,

$ jarsigner -keystore android.keystore -sigalg SHA1withRSA -digestalg SHA1 -verbose myApk.apk myAlias

the market shows the error like

Upload failed

Your APK has been signed with multiple certificates. Please only sign it with one certificate and upload it again.

Upload another APK
whitebear
  • 11,200
  • 24
  • 114
  • 237
  • android.keystore is use for debug not for publish apk so sign your apk using your custom keystore. – Haresh Chhelana Nov 13 '14 at 04:45
  • android.keystore is made by myself. I have release another apk with this keystore via eclipse. – whitebear Nov 13 '14 at 05:50
  • @whitebear Have you made two different certificate for it? – Piyush Nov 13 '14 at 07:05
  • possible duplicate of [Can I re-sign an .apk with a different certificate than what it came with?](http://stackoverflow.com/questions/3267216/can-i-re-sign-an-apk-with-a-different-certificate-than-what-it-came-with) – Devrim Nov 13 '14 at 07:15

4 Answers4

1

Whitebear try to update your SDK build tools from ask manager to version 20 or latest and create signed apk again and try.

Hope it works.

virendrao
  • 1,763
  • 2
  • 22
  • 42
1

Recently I updated to Android Studio 2.2 and started facing this issue. Solution: Delete generated signed APK and try generating again. Error Gone!

sumitarora
  • 580
  • 4
  • 18
0

jarsigner -keystore KeystoreName -storepass KeystorePasword -keypass KeystorePassword ExportedUnsignedApkName.apk KeystoreAlias

Example :

jarsigner -keystore MyCustomKeystore -storepass 123456 -keypass 123456 MyUnsign.apk mycustomkeystore

./zipalign -v 4 Unsignapkname.apk Signedapkname.apk

Example :

./zipalign -v 4 MyUnsign.apk MySign.apk

Haresh Chhelana
  • 24,720
  • 5
  • 57
  • 67
0

This work for me: http://developer.android.com/tools/building/building-cmdline.html#AutoReleaseMode

To specify your keystore and alias, open the project ant.properties<> file (found in the root of the project directory) and add entries for key.store and key.alias. For example:

key.store=path/to/my.keystore key.alias=mykeystore

ant release

It will prompt you to enter passphase for keystore and alias