-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Gym ignores provisioning profile retrieved by Match while building #28803
Comments
Facing same issue here. Help is appreciated. Virginia VA DMV |
It seems like passing
The problem remains that the Gym build ignores the provisioning profile retrieved by Match. I will update the Issue name and try to find further workarounds. I tried using I am now trying to use The code currently looks something like # ... match etc
sigh(adhoc: true)
update_project_provisioning
#... gym etc If this does not work I might try extracting the right profile path from the environment variables Match sets (namely I would much prefer to just have Match and Gym working together properly here, though.
But the advice it gives seems to plain not work when you want to switch provisioning profiles for one target definition. The last workaround would be to create additional targets with the correct provisioning profile set. But I'd rather not have 8 targets to manage. 4 is already absurd for just two app ids with basically the same app otherwise. I will report back as I try these workarounds |
If it's deemed that Gym shouldn't update the target definitions (fair, that is pretty intrusive) it would still be a big benefit to have Match and |
Reporting back: Using Sigh did not work for us:
I assume this is an incompatibility with how Match expects the api key, but I did not investigate further. I did however get all of this working with some manual plumbing from Match to app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
env_key = "sigh_#{app_identifier}_appstore_profile-path" # Replace appstore with adhoc for an adhoc build
# Needed because Match does not set the provisioning profile for Gym
update_project_provisioning(
profile: ENV[env_key]
) I also had to fix some values in the XCode project to get this working: disable_automatic_code_signing(
team_id: CredentialsManager::AppfileConfig.try_fetch_value(:team_id),
code_sign_identity: "iPhone Distribution"
) I hope this helps as a workaround |
Edit: I renamed the issue and want to provide a bit of context here. While Gym does use the correct provisioning profile while archiving the app, it does not modify the configuration of the target which means it's trying to be built with the "default" profile. This is fine if you only have one build profile, but we have several, which leads to errors in our pipelines where only the profiles actually loaded by Match are present. See this comment for the updatee.
New Issue Checklist
Issue Description
Edit: As stated above, this is not the core of the issue and "fixing" this just leads to new errors.
Gym does not pass the
-exportOptionsPlist
option toxcodebuild
when building.This can be seen in the difference between build_command_generator.rb and package_command_Generator_xcode7.rb
Why is this a problem?
We are developing a project with multiple app identifiers - one for production and one for development. This also means that we need different provisioning profiles.
Match does the right thing here, finding exactly the right profile. Gym also detects the options set by match, which can be seen in the "Summary for gym" section. The package-step also correctly passes
-exportOptionsPlist
, so the signing process would succeed if the build succeeded.Locally this would work because our development machines have all the necessary provisioning profiles installed. So the build would run with a not-quite-correct provisioning profile, but the signing would happen with the correct one. (Side note: we never tested uploading this result to the app store, for all we know it might fail there).
This is not really an option in our pipelines however, since match only downloads the actually needed profiles.
A preferred solution for us would be to add the
-exportOptionsPlist
argument to the build step.Command executed
bundle exec fastlane ios build_adhoc_prod
Complete output when running fastlane, including the stack trace and command used
Environment
🚫 fastlane environment 🚫
Stack
System Locale
fastlane files:
`./fastlane/Fastfile`
`./fastlane/Appfile`
fastlane gems
Loaded fastlane plugins:
No plugins Loaded
Loaded gems
The text was updated successfully, but these errors were encountered: