How to deploy to Google Play

Submitting your app to Google Play can be a little daunting the first time. With the below steps your app will be submitted to Google Play in no time.

Prerequisites

In order to upload to Google Play you are required to have access to an Android developer account.

Deploying your app to the Play Store takes a few days to complete and consists of the following steps:

Step 1: Generate a signing key

You can generate a private signing key using the following command:

keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

This command prompts you for passwords for the keystore and key. Write down your password, you will need it later. It then generates the keystore as a file called my-release-key.keystore.

Note: On Windows keytool must be run from C:\Program Files\Java\jdkx.x.x_x\bin

Step 2: Add your keystore in the android/app

Place the my-release-key.keystore file inside the android/app directory in your project folder.

Next, open the file android/gradle.properties and add the following variables (replace ***** with the correct keystore password, alias and key password):

MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****

Step 3: Changing App Name

Open android/src/main/res/values/strings.xml and change the app_name value.

Step 4: Change bundle identifier:

Note: Skipping any of the changes below will result in errors once publishing your app to the Play Store.

Renamed your project subfolders (3 file name changes) from: "android/app/src/main/java/com/knowlephant/share/" to: "android/app/src/main/java/com/YOUR_COMPANY_NAME/YOUR_APP_NAME/"

Then manually switched the old and new package ids:

In: android/app/src/main/java/MY/APP/NEW_ID/MainActivity.java:

package MY.APP.NEW_ID;

In android/app/src/main/java/MY/APP/NEW_ID/MainApplication.java:

package MY.APP.NEW_ID;

In android/app/src/main/AndroidManifest.xml:

package="MY.APP.NEW_ID"

And in android/app/build.gradle:

applicationId "MY.APP.NEW_ID"

In android/app/BUCK:

android_build_config(
  package="MY.APP.NEW_ID"
)
android_resource(
  package="MY.APP.NEW_ID"
)

Finally do a Gradle' cleaning in the end using the following commands in Terminal/Command line:

cd android

./gradlew clean

Step 5: Generate the release APK:

./gradlew bundleRelease

The generated APK can be found in the following folder: /MobileApp/android/app/build/outputs/bundle/release/app-release.aab.

Step 6: Upload to Google Play Console

Assuming you have completed the Play Store app description, images, and all other fields Play Store requires for app submissions, you can now upload your app by:

  • Creating an Internal Testing track and add yourself as a tester.

  • Upload your app bundle.

  • Submit for internal testing.

Once you're happy with the build, you can promote your build for release to the Play Store.

Last updated