react-native-version icon indicating copy to clipboard operation
react-native-version copied to clipboard

Add support for ios MARKETING_VERSION build setting

Open archansel opened this issue 4 years ago • 6 comments

Since XCode 11, CFBundleShortVersionString is managed using $(MARKETING_VERSION) from build setting, not a static value anymore

In react-native-version:4.0.0 it replace the value using static one

before
	<key>CFBundleShortVersionString</key>
	<string>$(MARKETING_VERSION)</string>
after
	<key>CFBundleShortVersionString</key>
	<string>0.1.0</string>

It will be better if it can handle build setting and change it accordingly in build setting file MyApp.xcodeproj > project.pbxproj both in debug and release

			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				CURRENT_PROJECT_VERSION = 1;
				DEAD_CODE_STRIPPING = NO;
				INFOPLIST_FILE = BSQMobile/Info.plist;
				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
				MARKETING_VERSION = 1.0.0; // CHANGE THIS INSTEAD
				OTHER_LDFLAGS = (
					"$(inherited)",
					"-ObjC",
					"-lc++",
				);
				PRODUCT_BUNDLE_IDENTIFIER = binus.itdivision.mobilebsq;
				PRODUCT_NAME = BSQMobile;
				VERSIONING_SYSTEM = "apple-generic";
			};

archansel avatar Jun 13 '20 11:06 archansel

Turns out that it use CURRENT_PROJECT_VERSION for build version too

Maybe you could use this approach https://stackoverflow.com/questions/58585239/how-to-change-build-setting-versioning-in-xcode-11-using-script

archansel avatar Jun 14 '20 06:06 archansel

+1 I had the same issue. Is there a PR or a fork to allow this?

macdonaldr93 avatar Nov 07 '21 20:11 macdonaldr93

+1 here, also having the same

ChaossAdept7 avatar Dec 17 '21 11:12 ChaossAdept7

+1 here, also having the same

coldSeattle avatar Mar 01 '23 08:03 coldSeattle

+1

charneykaye avatar Oct 26 '23 20:10 charneykaye

+1

MARKETING_VERSION not change after npx react-native-version --never-amend --skip-tag --set-build 22

xcode version: Version 15.0.1 (15A507) "react-native-version": "^4.0.0", "react-native": "0.72.4",

macos : 14.0 (23A344)

krmao avatar Nov 24 '23 10:11 krmao