Deploying a React Native Android into Google Play Store :
There are a few pieces of information that you need to have prepared when launching your mobile app on both the App Store and Google Play. Read the blog by iLeaf for finding out the steps that are included with the process. They include:
App Icon: A 512×512 px icon. Transparency is sanctioned.
App Category: Cull is one of the Google Play categories.
Android Studio is installed and your native project is set up already through `react-native init YourProject` and contains the android folder with build/Gradle files
*TIP: if for some reason, the below steps don’t seem to work, endeavor to reset all the project dependencies
1. Effacing the package-lock.json file and node-modules folder;
2. Then re-install node modules utilizing `npm install`.
In android/app/build.gradle (Module: app) in defaultConfig object increment versionCode and versionName only.
*make sure that other settings in the default config (such as applicationId) and all of the signing configs (such as key alias, key password, and others ) stay the same throughout the versions of the app as they are cross-referenced: if something doesn’t match, the app does not get uploaded.
2. After the build version is changed you need to sync the build. Gradle file with project:
go to File > Sync Project with Gradle Files
Go to Build > Rebuild Project
3. Check that Run Settings have the device set up:
4. OPTIONAL step if default run options don’t work for an odd reason. In the Run, the configuration makes sure to:
Set Activity to com.yourProjectName.MainActivity
Target a USB Device or Emulator
In the ‘Before launch’ section set Gradle-aware Make as the first set before any other
5. in your emulator/physical USB device make sure any old app versions are uninstalled/deleted as this often produces conflicts when building a new version on the device
6. To rebuild, first, start rebuilding the JSX part (react-native code).
Make sure the following command opens a terminal process window (and previous terminal processes are closed ). From project root, in your terminal run ‘react-native run-android –variant=release’.
*Variant=release notes production setting. you can change those to ‘– variant=debug’
if successful to 100%, this generates app-release.apk file, you can find it at android/app/build/outputs/apk/release/apk-release
*potential source of confusion: android studio build generates a different app-release.apk file and stores it in a different location, make sure you find the right one
7. Now go to play.google.com/apps/publish console, press CREATE APPLICATION, or ‘Manage’ existing application to update.
8. go to Release management > App releases > Alpha or Beta or Production section, press `create release/edit release`.
9. Upload the app-release.apk from the correct folder (react-native generates one, android studio generates one as well, but in different locations, see step 6)
choose Alpha, Beta, or Production sections. You can always ‘upgrade’ alpha into Beta, into Production.
10. give reason for release of new version description between the tags at the bottom of page 11. ‘Save’ and then ‘Review’.
If it is a new app and ‘Review’ is deactivated for no apparent reason:
12. Fill out store presence, copyright, and other tabs with grey circles until the sections reach publishable (green circle) status.