问题描述
我在 Android 上使用 React Native.如何在应用程序中更新版本号?当我收到此错误时.
我正在按照这个 url 生成文件
您应该更改 android/app/build.gradle 中的
versionCode
和 versionName
代码>:
android {默认配置{版本代码 1版本名称1.0"{...}}{...}}
请注意,versionCode
必须是一个大于先前版本所用整数的整数,而 versionName
是可能向用户显示的人类可读版本.
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 urlhttps://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.
这篇关于如何更新本机应用程序的版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!