Publish React Native app on playstore || React native

 1. add / update version of app inside app/build.gradle 

    versionCode 1
    versionName "1.0"
    applicationId "com.yourapp"

2. verify package is same:- inside AndroidManifest.xml 

package="com.yourapp"

3. verify package is same :- inside src/main/java/com/yourapp

package com.yourapp;

4. generate keystore using this steps http://reactnative.dev/docs/signed-apk-android

5. make the changes in app/build.gradle 


    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://reactnative.dev/docs/signed-apk-android.
            signingConfig signingConfigs.release
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }

    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
                storeFile file(MYAPP_UPLOAD_STORE_FILE)
                storePassword MYAPP_UPLOAD_STORE_PASSWORD
                keyAlias MYAPP_UPLOAD_KEY_ALIAS
                keyPassword MYAPP_UPLOAD_KEY_PASSWORD
            }
        }
    }

6. inside gradle.properties 

MYAPP_UPLOAD_STORE_FILE=your_key_name.keystore
MYAPP_UPLOAD_KEY_ALIAS=your_key_alias
MYAPP_UPLOAD_STORE_PASSWORD=your_password
MYAPP_UPLOAD_KEY_PASSWORD=your_password

7. delete nodemodule related images from res drawable folder and also app.json file 

8. generate release apk 
  
cd android
./gradlew bundleRelease

9. you might get GC heap memory issue you can resolve it by adding below line in gradle.properties 

org.gradle.jvmargs=-Xmx4608m

10. once done you will see BUILD SUCCESSFUL message in cmd. That's it you can find your aab file inside app/builld/outputs/bundle/release/app-release.aab file which you can upload on playstore 

11. ERROR:-  On playstore you might get error like below
You must let us know whether your app is a COVID-19 contact tracing or status app.
to resolve this error follow steps given in https://stackoverflow.com/a/68820499/11982418

12 Warning:- This App Bundle contains native code, and you've not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug
To resolve this you can try this https://stackoverflow.com/a/68778908/11982418 and https://support.google.com/googleplay/android-developer/answer/9848633#upload_file&zippy=%2Cupload-files-using-play-console 


   

Post a Comment

Previous Post Next Post