How to generate a Google Play upload key and keystore for a Flutter app in Android Studio?
To generate a Google Play upload key and keystore for a Flutter app in Android Studio, follow these steps:
- Open a terminal window and navigate to the root directory of your Flutter project.
- Run the following command to create a new keystore:
- Enter a password for the keystore and confirm it.
- You will be prompted to enter your first and last name, organizational unit, organization, city, state, and country code.
- Once you have entered all the required information, the keystore will be created.
- Next, you need to create a key for the keystore.
- Run the following command to create a new key:
- Enter the same password you used to create the keystore.
- You will be prompted to enter your first and last name, organizational unit, organization, city, state, and country code again.
- Once you have entered all the required information, the key will be created.
- Now you need to export the keystore as a base64-encoded string.
- Run the following command to export the keystore:
- Copy the output of the command and save it in a safe place.
- Finally, you need to upload the keystore to the Google Play Console.
- Log in to the Google Play Console and go to the "Release management" page.
- Click on the "App signing" tab and then click on the "Upload keystore" button.
- Select the keystore file that you created earlier and click on the "Upload" button.
- Once the keystore has been uploaded, you will be able to use it to sign your app for release.
keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
keytool -genkeypair -v -alias upload -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000
keytool -exportcert -rfc -alias upload -keystore ~/upload-keystore.jks | base64