Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated xcodeproj version to handle variable substitution on bundle id #10853

Merged
merged 1 commit into from Nov 9, 2017

Conversation

dral3x
Copy link
Contributor

@dral3x dral3x commented Nov 9, 2017

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

What's happening when you have a project variable inside the bundle id? gym generates the export options plist this way

[09:45:07]: Generated plist file with the following values:
[09:45:07]: ▸ -----------------------------------------
[09:45:07]: ▸ {
[09:45:07]: ▸   "provisioningProfiles": {
[09:45:07]: ▸     "com.spreaker.ConsoleIPad${BUNDLE_ID_SUFFIX}": "SpreakerStudio AppStore Distribution"
[09:45:07]: ▸   },
[09:45:07]: ▸   "method": "app-store",
[09:45:07]: ▸   "signingStyle": "manual"
[09:45:07]: ▸ }
[09:45:07]: ▸ -----------------------------------------

But then xcrun fails since the bundle id does not find a match inside the plist.

[09:45:07]: $ /usr/bin/xcrun /usr/local/lib/ruby/gems/2.4.0/gems/fastlane-2.63.0/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh -exportArchive -exportOptionsPlist '/var/folders/tp/sprd0vmn59z943y4g15l0rs80000gn/T/gym_config20171109-2897-1nt1vly.plist' -archivePath /Users/alex/Library/Developer/Xcode/Archives/2017-11-09/Studio\ Prod\ 2017-11-09\ 09.37.52.xcarchive -exportPath '/var/folders/tp/sprd0vmn59z943y4g15l0rs80000gn/T/gym_output20171109-2897-1gfy2tz'
+ xcodebuild -exportArchive -exportOptionsPlist /var/folders/tp/sprd0vmn59z943y4g15l0rs80000gn/T/gym_config20171109-2897-1nt1vly.plist -archivePath '/Users/alex/Library/Developer/Xcode/Archives/2017-11-09/Studio Prod 2017-11-09 09.37.52.xcarchive' -exportPath /var/folders/tp/sprd0vmn59z943y4g15l0rs80000gn/T/gym_output20171109-2897-1gfy2tz
2017-11-09 09:45:08.309 xcodebuild[10586:58706] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/tp/sprd0vmn59z943y4g15l0rs80000gn/T/Studio Prod_2017-11-09_09-45-08.307.xcdistributionlogs'.
2017-11-09 09:45:10.378 xcodebuild[10586:58706] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7f7fa4f1dfd0>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
"Error Domain=IDEProvisioningErrorDomain Code=9 \"\"Studio.app\" requires a provisioning profile with the Push Notifications and iCloud features.\" UserInfo={NSLocalizedDescription=\"Studio.app\" requires a provisioning profile with the Push Notifications and iCloud features., NSLocalizedRecoverySuggestion=Add a profile to the \"provisioningProfiles\" dictionary in your Export Options property list.}"
)}
error: exportArchive: "Studio.app" requires a provisioning profile with the Push Notifications and iCloud features.

Error Domain=IDEProvisioningErrorDomain Code=9 ""Studio.app" requires a provisioning profile with the Push Notifications and iCloud features." UserInfo={NSLocalizedDescription="Studio.app" requires a provisioning profile with the Push Notifications and iCloud features., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}

** EXPORT FAILED **
[09:45:10]: Exit status: 70
[09:45:10]: No provisioning profile provided
[09:45:10]: Make sure to pass a valid provisioning for each required target
...

The workaround for this was to passing to gym, inside export_options, the plain bundle id of the app

gym(
    scheme: "Studio Prod",
    output_name: "Studio Prod",
    configuration: "ProdRelease",
    export_method: "app-store",
    export_options = { provisioningProfiles: { "com.spreaker.ConsoleIPad": "SpreakerStudio AppStore Distribution" } }
    )

The result with the workaround in place was the following

[10:03:47]: Generated plist file with the following values:
[10:03:47]: ▸ -----------------------------------------
[10:03:47]: ▸ {
[10:03:47]: ▸   "provisioningProfiles": {
[10:03:47]: ▸     "com.spreaker.ConsoleIPad": "SpreakerStudio AppStore Distribution",
[10:03:47]: ▸     "com.spreaker.ConsoleIPad${BUNDLE_ID_SUFFIX}": "SpreakerStudio AppStore Distribution"
[10:03:47]: ▸   },
[10:03:47]: ▸   "method": "app-store",
[10:03:47]: ▸   "signingStyle": "manual"
[10:03:47]: ▸ }
[10:03:47]: ▸ -----------------------------------------

The real fix is to update xcodeproj dependency to version 1.5.2+, where the variable substitution was addressed and fixed.
https://github.com/CocoaPods/Xcodeproj/releases/tag/1.5.2

Here the result after updating xcodeproj and removing the workaround

[10:12:30]: Generated plist file with the following values:
[10:12:30]: ▸ -----------------------------------------
[10:12:30]: ▸ {
[10:12:30]: ▸   "provisioningProfiles": {
[10:12:30]: ▸     "com.spreaker.ConsoleIPad": "SpreakerStudio AppStore Distribution"
[10:12:30]: ▸   },
[10:12:30]: ▸   "method": "app-store",
[10:12:30]: ▸   "signingStyle": "manual"
[10:12:30]: ▸ }
[10:12:30]: ▸ -----------------------------------------
[10:12:30]: $ /usr/bin/xcrun /usr/local/lib/ruby/gems/2.4.0/gems/fastlane-2.63.0/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh -exportArchive -exportOptionsPlist '/var/folders/tp/sprd0vmn59z943y4g15l0rs80000gn/T/gym_config20171109-19083-1t3l7ak.plist' -archivePath /Users/alex/Library/Developer/Xcode/Archives/2017-11-09/Studio\ Prod\ 2017-11-09\ 10.05.37.xcarchive -exportPath '/var/folders/tp/sprd0vmn59z943y4g15l0rs80000gn/T/gym_output20171109-19083-1hio6yg'
[10:13:06]: Compressing 27 dSYM(s)
[10:13:06]: $ cd '/Users/alex/Library/Developer/Xcode/Archives/2017-11-09/Studio Prod 2017-11-09 10.05.37.xcarchive/dSYMs' && zip -r '/workspace/ios-studio/build/Studio Prod.app.dSYM.zip' *.dSYM
...

Description

Just changed the dependency version of xcodeproj to be, at least 1.5.2

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@dral3x
Copy link
Contributor Author

dral3x commented Nov 9, 2017

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Nov 9, 2017
@dral3x
Copy link
Contributor Author

dral3x commented Nov 9, 2017

I discussed about this with @joshdholtz quite some time ago on Slack.
I'm doing this PR just now since I had the time to check that updating xcodeproj fixes the problem.

Copy link
Contributor

@jetersen jetersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@joshdholtz joshdholtz merged commit 298b3bf into fastlane:master Nov 9, 2017
@fastlane-bot
Copy link

Hey @dral3x 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

@fastlane-bot
Copy link

Congratulations! 🎉 This was released as part of fastlane 2.64.1 🚀

@fastlane fastlane locked and limited conversation to collaborators Jan 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants