react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

[Bug] Xcode 11 support

Open kesha-antonov opened this issue 7 years ago • 21 comments

Hey!

I'm unable to use code-push with Xcode 11. Becasuse Info.plist contains

<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>

And I receive error

Detecting ios app version:

Error: Command 'codepush release-react -a name/app_name -d Staging' failed with exception "The "CFBundleShortVersionString" key in the "ios/app_name/Info.plist" file needs to specify a valid semver string, containing both a major and minor version (e.g. 1.3.2, 1.1)."

Steps to Reproduce

  1. Open Xcode 11
  2. Set app version
  3. Try code push

Expected Behavior

Build & upload

Actual Behavior

Fails

Environment

  • react-native-code-push version: 5.7.0
  • react-native version: 0.59.10
  • iOS/Android/Windows version: iOS 13.0
  • Does this reproduce on a debug build or release build? Both
  • Does this reproduce on a simulator, or only on a physical device? Both

(The more info the faster we will be able to address it!)

kesha-antonov avatar Aug 23 '19 06:08 kesha-antonov

You can work around it by manually adding -t [your target version] to the end of the react-release command.

solidfox avatar Sep 26 '19 03:09 solidfox

+1

felixchan avatar Sep 29 '19 23:09 felixchan

Any news on this ?

Alaa-Ben avatar Oct 02 '19 09:10 Alaa-Ben

You can work around it by manually adding -t [your target version] to the end of the react-release command.

thanks.

tdinckaya avatar Nov 15 '19 13:11 tdinckaya

After build in Xcode change the $(MARKETING_VERSION) in info.plist file to your version number (ex: 1.7). I tried today and it works for me. I uploaded my version to App Store. I download my app from "Test Flight" app. And I use code-push release with new version number and without using -t option.

kadirakkaya avatar Nov 15 '19 16:11 kadirakkaya

If anybody is struggling with -t command, the build number from the xcode should be passed in double quotes - -t "4.6.2" something like this.

SurajMDurgad avatar Nov 19 '19 07:11 SurajMDurgad

pfff....

elribonazo avatar Nov 22 '19 16:11 elribonazo

@kadirakkaya 's solution works great. Edit your version number in Xcode, then just do a search for MARKETING_VERSION and replace it with your version number. Annoying extra step when making a new build version but easy enough and it works around the issue.

evelant avatar Nov 26 '19 22:11 evelant

Hi @kesha-antonov , Thank you for reporting!

I hope @kadirakkaya and @AndrewMorsillo answers were helped you, so I'll close the issue for now, but if you still have any questions, feel free to reopen it.

andreidubov avatar Feb 13 '20 07:02 andreidubov

Thanks guys!

kesha-antonov avatar Feb 14 '20 08:02 kesha-antonov

@andreidubov Will full Xcode 11 support (i.e. support for $(MARKETING_VERSION)) be provided in a future release? The latest release ([email protected]) still requires this workaround; it'd be a cleaner developer experience if we didn't need to have this extra step.

sunweiyang avatar Feb 19 '20 17:02 sunweiyang

Hi @sunweiyang, We know about this problem and now investigate it. I will keep you updated. Thank you for your question.

andreidubov avatar Feb 20 '20 07:02 andreidubov

What we've done is to put the release-react command as a npm script and instead of hardwritting the -t [version], used jq to pick it from package.json:

scripts: {
  "codepush": "appcenter codepush release-react ... -t `cat package.json | jq -r .version`"
}

jesobreira avatar Feb 27 '20 18:02 jesobreira

Hi guys, We released a fix for Xcode 11. Now it should works well. We will update the documentation a bit later. If you have any suggestions or comments, you can add it here or open a new issue.

PR link: https://github.com/microsoft/appcenter-cli/pull/751

andreidubov avatar Mar 11 '20 08:03 andreidubov

I'm still having this issue on "react-native-code-push": "6.2.0" Was thee fix merged with this version?

dihan avatar Apr 30 '20 20:04 dihan

Still broken on 6.3.0 for me. Have to supply -t manually for it to work. I am using xcconfig (set via pod install) to set the MARKETING_VERSION if that affects anything.

CyberMew avatar Jul 25 '20 21:07 CyberMew

@dihan @CyberMew this has nothing to do with react-native-code-push as fix was done for appcenter-cli. I had to remove appcenter-cli entirely and reinstall it again. Please check if you have it installed globally with -g flag as it said in the appcenter-cli manual.

vkachan avatar Jul 26 '20 10:07 vkachan

@dihan @CyberMew this has nothing to do with react-native-code-push as fix was done for appcenter-cli. I had to remove appcenter-cli entirely and reinstall it again. Please check if you have it installed globally with -g flag as it said in the appcenter-cli manual.

app center or code push is already the latest and global for me. In fact I just installed it for the first time a couple days ago, which by the time this issue is supposedly fixed.

CyberMew avatar Jul 26 '20 12:07 CyberMew

I'm still getting this error

MobileMon-Majestic avatar Jan 31 '23 15:01 MobileMon-Majestic

``still this error with RN 0.72.5 with command "appcenter codepush release-react -a / -s Staging".

it can't auto get the marketing_version from project.pbxproj. I have to add -t to command

Error: Command 'codepush release-react -a name/app_name -d Staging' failed with exception "The "CFBundleShortVersionString" key in the "ios/app_name/Info.plist" file needs to specify a valid semver string, containing both a major and minor version (e.g. 1.3.2, 1.1)."

phanvungoc96 avatar Oct 11 '23 09:10 phanvungoc96