DEV Community

It's Just Nifty
It's Just Nifty

Posted on • Originally published at niftylittleme.com on

You Created A React Native Android App? Cool. How Do You Publish It?

Note: This guide is for Windows only

So, I’ve been creating mobile apps. What have you been doing? Probably the same thing if you clicked on this article. Or maybe you’re just curious; however, I’m going to assume that you have created your React Native Android app already, and are ready to start tackling publishing it to Google Play.

So, how do you do that? Well, if you’re like younger me and think it’s as easy as the ABCs, you’re wrong. Let me just tell ya, I had one heck of a time trying to do this. But the struggle was worth it because now I get to share the steps. Without further ado, let’s jump right in!

Unsplash Image by Pathum Danthanarayana

The Image Above: Photo by Pathum Danthanarayana on Unsplash

Creating An AAB File

So what is an AAB file? To my understanding, it’s a file the Google Play Store prompts you for when trying to publish an app there. By the way, the AAB file is what Google Play calls the App Bundle.

Anyway, how do you generate one?

Well, the first step is creating an upload key keystore. I expect you to have a version of JDK installed because you need it to have a React Native Android app developed in the first place.

  • Have JDK Installed

  • Open CMD (Command Prompt) As Administrator

  • Navigate To JDK Bin Directory: C:\Program Files\Java\jdkx.x.x_x\bin

  • Run this Command: keytool -genkeypair -v -storetype PKCS12 -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

  • Enter Keystore Password When Prompted

  • Keep The Keystore File Private

  • Place the Keystore File In Your android/app Folder

  • Add This Code To Your android/gradle.properties file:

  • Add this code to your android/app/build.gradle:

  • Open CMD (Command Prompt) Again

  • Navigate To android/app

  • Run This Command: ./gradlew.bat bundleRelease

And after all of that, you should have an app-release.aab file. Make sure it’s in the android\app\build\outputs\bundle\release directory.

Inside The Google Play Console

After you did all of that there is more. Go to your Google Play Console, and yes, pay the $25. After you make that little investment, let’s get your Android app out there.

  • Create A New App In Your Google Play Console

  • Setup App By Completing All The Steps Listed

  • Manage Your App Listing

  • When Creating Releases, Upload The AAB File You Have Created For App Bundles

  • Go Through With Testing

  • Make Sure You Meet The Requirements

Additional Steps

You might want to update your app to fix bugs, errors, etc…

  • Change Version, Version Code, and Version Name In package.json and android/app/build.gradle

  • Open CMD (Command Prompt) Again!

  • Navigate To android/app

  • Run This Command: ./gradlew.bat bundleRelease

  • Create A New Release In The Google Play Console


And just like that, you are done, your app is published, and everyone is happy. Yay, splendid, and congrats! These are the steps I took, so follow them to a T and you should be fine.

Check out my other Articles! Learn how to set up Firebase in your React Native project. To find out what I'm writing next, subscribe to my newsletter. Also, check out my Medium if you like me so much.

Happy Coding Folks!

Top comments (0)