React native android build version code not updating
React native android build version code not updating
I have edited the versionCode in both the androidappbuild.gradle file :
versionCode 2
versionName "2.0"
and I have updated the AndroidManifest.xml file
package="com.reactnativeapp"
android:versionCode="2"
android:versionName="2.0"
BUT I still get this error when I try to release an update to my app on google play store!
You need to use a different version code for your APK or Android App Bundle
because you already have one with version code 1.
I have tried running
gradlew clean
in the android folder and rebuilding the project and nothing has worked. Does anyone have any ideas?
1 Answer
1
Make sure that you have your versionCode and versionName set inside defaultConfig like this:
versionCode
versionName
defaultConfig
android {
...
defaultConfig {
versionCode = 2
versionName = "2.0"
}
...
}
You might have it set up for a debug-only config, which wouldn't change for release builds.
Did you try version code without quotation marks?
– Noah Allen
Jul 2 at 23:46
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Tried that, it didn't work :(
– ethan
Jul 2 at 23:21