When your React Native app is ready, the next step is to publish it on the Google Play Store. To do that, you need .aab file (Android App Bundle). For sharing and testing you need an .apk file (Android Package Kit).
Some developers overcomplicate the process, but it’s straightforward. In this guide, I’ll show you the step-by-step process on Windows.
Step 1: Generate an Upload Key
Google requires you to sign your app with a secure key before uploading. You can generate it with the keytool command.
Open Command Prompt (CMD) or PowerShell and run:
keytool -genkeypair -v -keystore my-release-key.keystore -alias myappkey -keyalg RSA -keysize 2048 -validity 10000
1. my-release-key.keystore → your keystore file (you can rename it).
2. myappkey → alias name (used to identify your key).
3. 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.
-
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
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:
cd android
./gradlew assembleRelease
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
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.