'How to force Flutter to update my version and build number?

  1. I've changed my version in pubspec.yaml to 1.0.1+1 (from 1.0.0+3)
  2. flutter clean
  3. flutter build ios
  4. When I open [project]/ios/Runner.xcworkspace it still shows me 1.0.0 version.

What am I doing wrong? How can I force Xcode to update my version from CLI or pubspec.yaml?

This is how my Info.plist looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleDisplayName</key>
    <string>Name</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Sundee</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>$(MARKETING_VERSION)</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>$(CURRENT_PROJECT_VERSION)</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <string>Your location will be used to determine sun angle.</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>Your location will be used to determine sun angle.</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Your location will be used to determine sun angle.</string>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
</dict>
</plist>


Solution 1:[1]

I got it. It's because my lines in my Info.plist did not look like the following:

    <key>CFBundleShortVersionString</key>     
    <string>$(FLUTTER_BUILD_NAME)</string> 
    <key>CFBundleVersion</key> 
    <string>$(FLUTTER_BUILD_NUMBER)</string>

Anyone has an idea why I had $(MARKETING_VERSION) and $(CURRENT_PROJECT_VERSION)?

Solution 2:[2]

The same thing happened to me.

I think that when I used the xcode interface he changed the file ios/Runner.xcodeproj/project.pbxproj and he didn't get the value automatically

I solved it like this.

change this:

CURRENT_PROJECT_VERSION = your buildnumber
MARKETING_VERSION = your version

to:

CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)";

this appears 3 times

Solution 3:[3]

You need also get package.

CFBundleShortVersionString is the public "name" of the version (example: "2.5", or "3.8.1"). You must increase it at each release.

CFBundleVersion is the private build number. It is not seen on the AppStore. You must increase it at each upload. It means that if you ever reject a binary before it goes online, and you want to upload a new binary, it will have the same

CFBundleShortVersionString but must have a higher CFBundleVersion (example: public "2.5", private "2.5", and then binary reject, and re-upload private "2.5.1")

Solution 4:[4]

To achieve this, you have to add some values in CfBundleVersionShortString

Like:

   <key>CFBundleShortVersionString</key>
   <string>1.0</string> 

And give the build value in Runner as 1.0 and version as 1.0

screenshot

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Elvis Teles
Solution 3 Yousif khalid
Solution 4 Dani3le_