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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With