Group Group Group Group Group Group Group Group Group

Fastlane for iOS · Match | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1259223-fastlane-for-ios/lessons/13

Hi, I have problem with Adhoc license using match. I got an error for “iCloudContainerEnvironment” key. When I run app store license using match, everything is working fine while export.

I haven’t personally encountered this kind of issue, but fastlane support shows this has been an issue for some people. It looks like the problem usually boils down to having a mismatch between the environment selected (say, “development”) and the type of action being required (e.g., “app store”). That said, I can’t find any references at all to people having this problem when running match (every support issue I could find for this was related to another fastlane tool called gym, which we cover in Section 3).

Can you check to make sure that you nuked your existing Certificates and then try running fastlane match adhoc once again? If the problem persists, I’ll be happy to work with you in submitting an issue to the fastlane team, which is typically quite responsive and helpful!

Thank you for swift response.

I tried many times even after nuke. “iCloudContainerEnvironment” didn’t include automatically for Adhoc but it works flawlessly with AppStore.

I saw my cert in developers portal and it does include iCloud value in cert.

Hmmm… I know this is a bit redundant, but just to confirm, this happens when you run fastlane match adhoc, but both fastlane match development and fastlane match App Store work as expected for you?

Yes, for me i only happened when i run fastlane match adhoc and then build with adhoc.

That might point us in a direction I can help with. When you say “…and then build with adhoc”, do you mean using gym? Specifically, it sounds like maybe the command fastlane match adhoc doesn’t throw this error in itself, but rather that you get this error when you invoke gym. Is that right?

Yes, You are right. I got error when build with adhoc using gym.

I’m unable to add another reply so i’m adding comments for below post.

Hi, I appreciate your efforts and swift response. I already tried it but the problem is after using manual export_options it overrides match settings.

I also read in documentation if you are using match you don’t need to mention export_options.

Great! Now that I know this issue occurs with gym I think we can resolve your issue. :slight_smile:

If you do some web searching, you can find several people reporting issues using gym with ad hoc certificates. Here’s 2 examples:


Generally, the resolution of your issue comes down to providing gym a bit more information, so it can correctly select the right assets to use. Specifically, I’d suggest adding this to your ad hoc gym command:

gym(
  …
  export_method: "ad-hoc",
  export_options: {iCloudContainerEnvironment: 'Production']}
) 

As usual, you can dig a bit deeper and learn more about how to tune gym via its documentation page. Good luck!