Skip to content

Commit 760e617

Browse files
committed
fix(ios): let flutter drive the bundle version instead of the xcode project
The Runner target hardcoded FLUTTER_BUILD_NUMBER = 200 and FLUTTER_BUILD_NAME = 6.13.0 in all three of its build configurations. Apple documents target-level settings as applied after a build configuration file, so these overrode the values Flutter writes into Generated.xcconfig — Info.plist reads CFBundleVersion from $(FLUTTER_BUILD_NUMBER), so every iOS build shipped as build 200 no matter what --build-number was passed. That is why the release workflow's CFBundleVersion assertion failed on the first archive that got far enough to be checked. Left alone it would have been worse than a failed check: the first upload would have taken build 200 and every later one would have been rejected by App Store Connect as already used. Remove both settings so the generated xcconfig owns them, and point Xcode's own CURRENT_PROJECT_VERSION and MARKETING_VERSION at the Flutter values rather than frozen copies that drift from pubspec at every release.
1 parent aa5e96a commit 760e617

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,9 @@
481481
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
482482
CLANG_ENABLE_MODULES = YES;
483483
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
484-
CURRENT_PROJECT_VERSION = 200;
484+
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
485485
DEVELOPMENT_TEAM = BX99T32YGS;
486486
ENABLE_BITCODE = NO;
487-
FLUTTER_BUILD_NAME = 6.13.0;
488-
FLUTTER_BUILD_NUMBER = 200;
489487
INFOPLIST_FILE = Runner/Info.plist;
490488
INFOPLIST_KEY_CFBundleDisplayName = BULL;
491489
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
@@ -494,7 +492,7 @@
494492
"$(inherited)",
495493
"@executable_path/Frameworks",
496494
);
497-
MARKETING_VERSION = 6.13.0;
495+
MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)";
498496
PRODUCT_BUNDLE_IDENTIFIER = com.bullbitcoin.app;
499497
PRODUCT_NAME = "$(TARGET_NAME)";
500498
STRIP_STYLE = "non-global";
@@ -674,11 +672,9 @@
674672
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
675673
CLANG_ENABLE_MODULES = YES;
676674
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
677-
CURRENT_PROJECT_VERSION = 200;
675+
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
678676
DEVELOPMENT_TEAM = BX99T32YGS;
679677
ENABLE_BITCODE = NO;
680-
FLUTTER_BUILD_NAME = 6.13.0;
681-
FLUTTER_BUILD_NUMBER = 200;
682678
INFOPLIST_FILE = Runner/Info.plist;
683679
INFOPLIST_KEY_CFBundleDisplayName = BULL;
684680
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
@@ -687,7 +683,7 @@
687683
"$(inherited)",
688684
"@executable_path/Frameworks",
689685
);
690-
MARKETING_VERSION = 6.13.0;
686+
MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)";
691687
PRODUCT_BUNDLE_IDENTIFIER = com.bullbitcoin.app;
692688
PRODUCT_NAME = "$(TARGET_NAME)";
693689
STRIP_STYLE = "non-global";
@@ -705,11 +701,9 @@
705701
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
706702
CLANG_ENABLE_MODULES = YES;
707703
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
708-
CURRENT_PROJECT_VERSION = 200;
704+
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
709705
DEVELOPMENT_TEAM = BX99T32YGS;
710706
ENABLE_BITCODE = NO;
711-
FLUTTER_BUILD_NAME = 6.13.0;
712-
FLUTTER_BUILD_NUMBER = 200;
713707
INFOPLIST_FILE = Runner/Info.plist;
714708
INFOPLIST_KEY_CFBundleDisplayName = BULL;
715709
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
@@ -718,7 +712,7 @@
718712
"$(inherited)",
719713
"@executable_path/Frameworks",
720714
);
721-
MARKETING_VERSION = 6.13.0;
715+
MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)";
722716
PRODUCT_BUNDLE_IDENTIFIER = com.bullbitcoin.app;
723717
PRODUCT_NAME = "$(TARGET_NAME)";
724718
STRIP_STYLE = "non-global";

0 commit comments

Comments
 (0)