Android – How to update version number of react native app

androidreact-native

I am using React native with Android. How can I update version number in the app? As I am getting this error.

I am generating file as per this url
https://facebook.github.io/react-native/docs/signed-apk-android.html

I have tried modifying AndroidManifest.xml file, but after I build it, that file gets automatically modified back.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.facebook.react"
    android:versionCode="1"
    android:versionName="1.0" >

Here, I modified the XML:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.facebook.react"
    android:versionCode="2"
    android:versionName="1.1" >

After, build file automatically changes back.

enter image description here

Best Answer

You should be changing your versionCode and versionName in android/app/build.gradle:

android {

    defaultConfig {

        versionCode 1
        versionName "1.0"

        {...}
    }

    {...}
}
Related Topic