DEV Community

Zachary Powell
Zachary Powell

Posted on

5 1

Common errors found when generating Android certificates (and how to fix them!)

AppGallery supports two kinds of signing certificates: one that is totally generated by AppGallery Connect and the other one that is generated by developers. Here I will share some solutions with you for the common errors reported during the signing certificate generation.
The command in the official document is as follows:

java -jar pepk.jar --keystore test.jks --alias test --output=output.zip
\ --encryptionkey=034200041E224EE22B45D19B23DB91BA9F52DE0A06513E03A5821409B34976FDEED6E0A47DBA48CC249DD93734A6C5D9A0F43461F9E140F278A5D2860846C2CF5D2C3C02
\ --include-cert
view raw signing.sh hosted with ❤ by GitHub

Error 1 - "No value provided for flag: include-cer"

Image description
Cause: It is not the correct pepk.jar file. Normally, its file size is around 2 MB. Check whether it is the file that was provided by Android Studio.
Solution: Use the correct pepk.jar file that you can get from Google.

Error 2: "java.io.IOException: Keystore was tampered with, or password was incorrect"

Image description
Cause: The keystore password is most likely not correct.
Solution: Enter the correct password.

Error 3: "Unable to export or encrypt the private key"

Image description
Cause: Incorrect password. The keystore password is entered correctly, but the key file password is entered incorrectly when entered for the second time.
Solution: Enter the correct key file password.

Error 4: "Unable to parse the input:"

Image description
Cause: The length of the encryption key is incorrect. Check whether you have copied the complete encryption key.
Solution: Use the complete encryption key.

Error 5: "java.lang.IllegalArgumentException: publicKey should be 68 bytes"

Image description
Image description
Cause: The length of the encryption key is incorrect. Check whether you have copied the complete encryption key.
Solution: Use the complete encryption key.

Error 6: "java.lang.IllegalArgumentException: Hex encoded byte array must have even length but instead has length: 143."

Image description
Cause: The encryption key is too long.
Solution: Use the correct encryption key

Error 7: "java.security.GeneralSecurityException: point is not on the curve"

Image description
Cause: The encryption key is incorrect.
Solution: Use the correct encryption key.

Top comments (0)

Sentry image

Make it make sense

Only the context you need to fix your broken code with Sentry.

Start debugging →