I am unable to export or encrypt the android.keystore file for the Google App Signing. My App was updated back in 2018 lastly. How do I solve this?

C:\Users++++\Desktop> java -jar pepk.jar --keystore=android.keystore --alias=androidkey --output=output.zip --include-cert --rsa-aes-encryption --encryption-key-path=private_key.pem
Enter password for store 'android.keystore':

Enter password for key 'androidkey':

Error: Unable to export or encrypt the private key
java.security.NoSuchAlgorithmException: Cannot find any provider supporting RSA/NONE/OAEPWithSHA1AndMGF1Padding
at java.base/javax.crypto.Cipher.getInstance(Cipher.java:574)
at com.google.wireless.android.vending.developer.signing.tools.extern.export.ExportEncryptedPrivateKeyTool.encryptPrivateKeyWithCkmRsaAesKeyWrapEncryption(ExportEncryptedPrivateKeyTool.java:284)
at com.google.wireless.android.vending.developer.signing.tools.extern.export.ExportEncryptedPrivateKeyTool.run(ExportEncryptedPrivateKeyTool.java:213)
at com.google.wireless.android.vending.developer.signing.tools.extern.export.ExportEncryptedPrivateKeyTool.main(ExportEncryptedPrivateKeyTool.java:165)

  1. I use JDK 21
  2. I changed the name of the .pem file to private_key.pem
  3. I have JRE installed, but no Android SDK.
  4. I am trying to sign an app that i have last updated in 2018
  5. I find out that when i localize the java.exe and run it, the program flashes just quickly and closes itself.
    What can i do?

First of all, very slowly from the beginning:

  1. You released an AI2 app on the Play Store in 2018, right?
  2. You have saved the keystore with which the app was signed and have access to it, right?
  3. You now have built a new version of your app (from 2018) in 2024 with the same AI2 account, without having changed the keystore in the meantime. Correct?
  4. Have you created the new version (update) as an APK (or an AAB) file?
  5. Then you tried to publish this app (APK) on Play Store?
  6. If so, what exactly is the problem / what error messages appear (screenshots)?
1 Like

Long story short, if the app was built with AI2 and you haven't changed the keystore, you can still publish the new update as an APK. There should then be no problems with the keystore (especially if you have not activated Google App signing). I've been doing this with all of my apps in the Play Store for more than 10 years.

1 Like

I also remember that i did some stuff with AppToMarket back then, because my app was too big (6+MB). But now i see the size limit is 100 MB.

  1. You released an AI2 app on the Play Store in 2018, right? yes

  2. You have saved the keystore with which the app was signed and have access to it, right? Yes, but i am trying to sign while using a newly exported keystore. Should i not?

  3. You now have built a new version of your app (from 2018) in 2024 with the same AI2 account, without having changed the keystore in the meantime. Correct? I have an old Keystore, backed in one of my ald folder for the APP. Maybe it was the very last Keystore i expored back then. But then i made in reality not modification on my app, i just wanted to export a new version and upload it on G-Play, because they are telling me, the API level to too old. I dont think i changed the keystore on MIT-AI.

  4. Have you created the new version (update) as an APK (or an AAB) file? Both
    G-Playstore tells me for .aab file i have to sign it, and for the new .apk file: it says the fingerprint of the signing certificate is not the same (so how do i get the old fingerprint?)

  5. Then you tried to publish this app (APK) on Play Store? Yes, for the new apk. fingerprint is not the same playstore says, and i am having trouble signing the keystore file to upload the new aab file.

  6. If so, what exactly is the problem / what error messages appear (screenshots)?

No.

Then the keystore is not the same as with your app (APK) from 2018.


See also here:

Thank you.
What can i do if i cannot find the old keystore?

https://support.google.com/googleplay/android-developer/thread/217671204?hl=en&sjid=16314030383702956581-EU

There is nothing i can do there.

I am now trying to sign the aab file to upload and i get the error above on the terminal.
Why do i get that error? It has nothing to do with a keystore i suppose?

Since you haven't updated your app since 2018, it is no longer available in the Play Store for newer Android versions (> API 27 or 28 / Android 8 or 9). The easiest way is to create a new app with a slightly different package name and then publish it in the Play Store.

Of course, you then need to create an AAB and upload it to the Play Developer console and publish it.