Method 1: Android Studio generation

Generating signature Files

  1. Select Generate Signed Bundle/APK in Build…
  2. Select APK, click Next, and select Create New… Creating a key store
  3. Fill in the keystore information and click OK
  4. To generate an error

Failed to generate signature file. Procedure

Key was created with errors: Warning: JKS �Կ��ʹ� ʹ� keytool -importkeystore -srckeystore E:\andorid_code\XXX\XXX\keystore\keystoreName -destkeystore E:\andorid_code\XXX\XXX\keystore\keystoreName. JKS -deststoreType PKCS12 "quantity � E E:\andorid_code\XXX\XXX\keystore\keystoreNameCopy the code

Since JKS keystores use a proprietary format, it is recommended that we use the keytool command to generate a standard key file and migrate to the industry standard format PKCS12

To solve

Keytool -importkeystore -srckeystore Source file path -destkeystore target file path -deststoreType pkcs12Copy the code

Derinputstream.getlength (): lengthTag=109, too big

The file path is too long. Copy it and try again

Enter the target keystore password: Enter a new password again: Enter the source keystore password: the entry with the alias keyAliasName has been successfully imported. Import command completed: 1 entry successfully imported, 0 entries failed or cancelledCopy the code

Method 2. Keytool command generation

Enter the project app directory command line and enter:

keytool -genkey -alias yourAliasName -keypass 888888 -keyalg RSA -keysize 2048 -validity 36500 -keystore E:\andorid_code\xxx\app\keystore\yourStoreName.jks -storepass 888888 -storetype pkcs12
Copy the code

View keystore information

Keytool -v -list -keystore yourStoreName. JKS Keytool Error: Invalid keystore format java.io.IOException: Invalid keystore format at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:650) at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:55) at java.security.KeyStore.load(KeyStore.java:1445) at sun.security.tools.keytool.Main.doCommands(Main.java:792) at sun.security.tools.keytool.Main.run(Main.java:340) at sun.security.tools.keytool.Main.main(Main.java:333)Copy the code

-storeType PKCS12 is required

keytool -v -list -storetype pkcs12 -keystore yourStoreName.jks

Copy the code