IOS/XCode: Wrong provision profile selection by iOS Auto Provision for Same export type and Team, but different bundleID

Bitrise Build Issue Report template

Part of CI worklfow I am trying to get my Beta APP on TestFlight , so far I have two different provision profiles with the same Export Type app-store , same Team but different Bundle ID

During my iOS Auto Provision step using the distribution type app-store it selects the wrong provisioning profile. I tried to stay true to the documentation but I see there is no way to uniquely specify to select provision profile on the basis of the Bundle ID.

The following step XCODE ARCHIVE clearly fails because it cannot match the selected entitlement with provision profile.

Unless I missed something, how do I specify to select a specific Bundle ID’s provision profile?

Environment:

Standard Machine
Linux
2xCPU (n1) / 7.5 GB RAM
macOS
2xCPU (Intel Xeon X5570) / 4 GB RAM
Using iOS Auto Provision 1.1.3

Reproducibility

  • _Does a “Rebuild” help? : NO
  • _Does a rebuild without caches help? NO
  • Does the issue happen sporadically, or every time? : Everytime
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : At First Instance

Local reproduction

It cannot be reproducted locally because the provisioning profile is from the server side Bitrise and not something you can test against your local setup. The closest thing to test this against local is to run via XCode Archive - in which it does work properly and able to push the Beta app.

Build log

:x: error: exportArchive: No profiles for ‘com.chefsplate.mobileapp.beta’ were found

IDEDistribution.critical.log:
2018-08-09 20:44:54 +0000 [MT] Step failed: <IDEDistributionSigningAssetsStep: 0x7fceaf7a7f00>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 “Locating signing assets failed.” UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
“Error Domain=IDEProfileLocatorErrorDomain Code=1 "No profiles for ‘com.chefsplate.mobileapp.beta’ were found" UserInfo={NSLocalizedDescription=No profiles for ‘com.chefsplate.mobileapp.beta’ were found, NSLocalizedRecoverySuggestion=Xcode couldn’t find any iOS App Store provisioning profiles matching ‘com.chefsplate.mobileapp.beta’. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}”
)}

I have the same issue and now the build aborted with this error.

Internal error: failed to create or connect to the perfect build environment. Don’t worry, build should restart soon.

Hi @trick14 ,
The current issue with abort is unrelated to the codesigning issue. We are really sorry for the inconvenience caused! Our infra team started investigating the issue. This issue is currently affecting our Mac stacks (it shouldn’t have any impact on our Linux stacks). Sadly I can’t provide an ETA yet on a fix.

Hi @adityac26,
Could you send us the URL of the failed build so we can investigate the issue?

@tamasbazsonyi Thanks so much for helping. https://app.bitrise.io/build/1717ddd11064576b

Unless you are with official bitrise support , I am not usre how anyone else can see the log from this build? In any case , please let me know if the above link helps.

Thanks!

@adityac26 no problem! :wink:Could you set the Should the step try to generate Provisioning Profiles even if Xcode managed signing is enabled in the Xcode project? input of the XCode Archive step to yes and try building again? This would allow the step to create the needed provisioning profiles in your developer portal.

@tamasbazsonyi sorry I am unable to find such options in step itself? I was using the version 2.4.6 and its not there. For the sake of resolving the issue with you - I also looked at the latest version of the XCode Archive 2.4.12 but still was not able to find this option.

Sorry please ignore the above ^ - I see the option not in XCode Archive step but the iOS Auto Provision step instead. Okay I selected that to yes and trying the build again! Will update shortly

@tamasbazsonyi :frowning_face: Unfortunately it still failed. New Log: https://app.bitrise.io/build/926017f586ca7c16

Please advice!

@tamasbazsonyi Did you get a chance to take a look at the new logs? Any help would be appreciated please

Hi @adityac26 !

Could you please add a “Replaces Xcode’s project PRODUCT_BUNDLE_IDENTIFIER” step before the “iOS Auto Provision” step with this inputs:
“Xcode project path”: ios/mobileApp.xcodeproj
“New bundle identifier”: $IOS_APP_BUNDLE_ID

This will change the bundle ID in the project file as well.

After this, the “iOS Auto Provision” step will find for the right bundle ID.


Update please the “Xcode Archive & Export for iOS” step to v2.4.10;


Change the in the “Should the step try to generate Provisioning Profiles even if Xcode managed signing is enabled in the Xcode project?
" input” to no in the “iOS Auto Provision” step.


Export an “App Store” IPA via Xcode in your local machine with the “Automatically manage signing” option.
Be sure, your bunlde ID is com.chefsplate.mobileapp.beta

It will generate an ExportOption.plist as well.
Copy it’s content to the “Custom export options plist content” input (under the Export Options Debug section) in “Xcode Archive & Export for iOS” step.


And try a new build.

1 Like

@BirmacherAkos Thanks so much for your help. I see that you have made a new workflow to test.

I followed your instructions: Here is my status

  1. Auto Provision Step - Add path and bundle identifier - Completed and Validated :white_check_mark:
  2. Update XCode Archive to v2.4.10 - Completed and Validated :white_check_mark:
  3. Input ‘no’ in the ‘iOS Auto Provision’ Step - Failed :x:
    :point_up: Failed for me because it does not seem to find com.chefsplate.mobileapp.beta provisioned profile. The only way i got it to work was to assign yes to generate provision profile (log: Bitrise - Mobile Continuous Integration and Delivery - iOS & Android Build Automation)
  4. I was successfully was able to export app-store IPA via XCODE for com.chefsplate.mobileapp.beta however it only generated a generic plist file for me:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>method</key>
	<string>app-store</string>
	<key>signingStyle</key>
	<string>automatic</string>
	<key>stripSwiftSymbols</key>
	<true/>
	<key>teamID</key>
	<string>T6E43PY73P</string>
	<key>uploadBitcode</key>
	<true/>
	<key>uploadSymbols</key>
	<true/>
</dict>
</plist>

Either way I used it and still was unable to get my Chefs Plate Dev App to get it to archive. I get the following error:

:x: Error Domain=IDEProvisioningErrorDomain Code=9 ""Chefs Plate Dev.app" requires a provisioning profile with the Associated Domains feature." UserInfo={NSLocalizedDescription="Chefs Plate Dev.app" requires a provisioning profile with the Associated Domains feature., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.

> ❌  error: exportArchive: "Chefs Plate Dev.app" requires a provisioning profile with the Associated Domains feature.

> ❌  Error Domain=IDEProvisioningErrorDomain Code=9 ""Chefs Plate Dev.app" requires a provisioning profile with the Associated Domains feature." UserInfo={NSLocalizedDescription="Chefs Plate Dev.app" requires a provisioning profile with the Associated Domains feature., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}

I appreciate the fantastic help you have provided me thus far. I feel like we are very close to resolving this - please provide me with the next steps in order to bring this to finish line. Thank you so much!

Looking forward to your reply!

Thanks,
Adi

@BirmacherAkos Any suggestions?

Hi!

Sorry for the delayed answer.

In your build #702 you have used the uploaded profiles to create the Archive.
You uploaded the Xcode Managed Provisioning Profile for App-Store but you have forgotten to upload the Xcode Managed Provisioning Profile for Development (Xcode need this to create the archive before the IPA export).

Could you please upload the Xcode Managed Provisioning Profile for Development profile and try to run the “SUPPORT_WORKLOW” again?

Thanks @BirmacherAkos for your help. I was able to resolve it by adding the missing provisioning profiles. Also, our ${suffix} did not work for us as it appended two suffixes during archive step and it worked!

Thank you so much!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.