Hi Developers I'm Saad.
After successfully creating your React Native App, every developer is in hurry to upload on Google Playstore.
Firstly run your app on emulator and if it is bug free. Here you have follow few simple steps and here we go...
** Step 1. Generate Private Key in terminal.
open terminal and paste this**
keytool -genkeypair -v -storetype PKCS12 -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
- my-release-key.keystore → your keystore file (you can rename it).
- myappkey → alias name (used to identify your key).
- 10000 → validity in days (~27 years).
The command will ask for a password, name, organization, city, state, and country code. Remember your keystore password and alias details — you’ll need them later.
*Step 2: Move the Keystore File *
After generation, you’ll find the my-release-key.keystore file in your user directory.
Copy it into your React Native project at:
your_project/android/app/
** Step 3: Configure Gradle to Use the Keystore **
Now you need to tell Gradle how to use this keystore.
a--Open android/gradle.properties and add:
`MYAPP_UPLOAD_STORE_FILE=my-release-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=myappkey
MYAPP_UPLOAD_STORE_PASSWORD=your-keystore-password
MYAPP_UPLOAD_KEY_PASSWORD=your-key-password `
b--Replace with your own password and remember to.
Open android/app/build.gradle and add signing configs:
**
Step 4: Build the .apk or .aab **
Open a terminal inside your project root and run:
For .apk:
cd android
./gradlew assembleRelease
For .aab:
cd android
./gradlew bundleRelease
*Step 5: Locate the Output Files *
The .apk file will be at:
android/app/build/outputs/apk/release/app-release.apk
The .aab file will be at:
android/app/build/outputs/bundle/release/app-release.aab
These are your signed release files, ready for uploading to the Google Play Console.
*Final Notes- *
Always keep your keystore file safe. Losing it means you cannot update your app on the Play Store.
Use .aab when uploading to Play Store (Google requires it now), but you can still use .apk for testing or sharing.
If you face Gradle issues, try cleaning the build:
cd android
./gradlew clean
That’s it! You’ve successfully built .apk and .aab files on Windows for your React Native app.
Top comments (0)