Isaac
Isaac

Reputation: 12874

How should we use the same version for both iOS and Android

Currently whenever I made changes to React Native applications, I will have to change version number in multiple places

1. package.json

{
  "name": "My Awesome App",
  "version": "1.2.0",
  ...
}

2. ios/MyAwesomeApp/Info.plist

<key>CFBundleShortVersionString</key>
<string>1.2.0</string>

3. android/app/build.gradle

defaultConfig {
    ...
    versionCode 1
    versionName "1.2.0"

4. Update versioning number in my "About" app component

Is there a much simpler way to handle updating versioning like for example configuring in such a way where Info.plist and build.gradle automatically pointing to package.json?

Upvotes: 5

Views: 2870

Answers (1)

Matei Radu
Matei Radu

Reputation: 2078

You could use react-native-version-up which allows you to bump the version in different ways in your package.json, build.gradle and info.plist.

Personally, I do not go with the approach of keeping all in sync. Since I'm following semver for all my JS-based projects, it can happen that some changes (i.e. a bugfix) affect only one platform and in that case, I would need to bump the version only for that one platform.

Upvotes: 7

Related Questions