Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update version number of react native app

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

like image 876
Praveen Prasad Avatar asked Mar 10 '16 18:03

Praveen Prasad


1 Answers

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

android {      defaultConfig {          versionCode 1         versionName "1.0"                  {...}     }      {...} } 

Note that versionCode has to be in an integer that is larger than the ones used for previous releases while versionName is the human readable version that may be shown to users.

like image 153
Joseph Roque Avatar answered Oct 06 '22 00:10

Joseph Roque