Xcode 9 XCODEBUILD exportArchive errors

I have a project where I have used Cocoapods (1.4.0) to include 6 frameworks. At the end of the POD INSTALL, I now am using an .xcworkspace with two projects in it: my original project "<MY_APP>" + a PODS project. A proper provisioning profile for the <My_APP> is in the respective <MY_APP>.xcodeproj file. Using the Xcode IDE, I can build, archive, and export the app just fine.


If I try to automate the build from the command line and use XCODEBUILD, I can build and archive the project what I cannot do is the EXPORTARCHIVE command, as it fails as follows :


```

2018-01-28 19:29:09.262 xcodebuild[26525:792158] [MT] IDEDistribution:

-[IDEDistributionLogging _createLoggingBundleAtPath:]:

Created bundle at path '/var/folders/bp/9886401s3l36_z01xnghn6180000gn/T/<MY_APP>_2018-01-28_19-29-09.261.xcdistributionlogs'.


2018-01-28 19:29:10.268 xcodebuild[26525:792158] [MT] IDEDistribution:

Step failed: <IDEDistributionSigningAssetsStep: 0x7fa56dbf9140>:

Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed."

UserInfo={NSLocalizedDescription=Locating signing assets failed.,

IDEDistributionSigningAssetStepUnderlyingErrors=(


"Error Domain=IDEProvisioningErrorDomain Code=10 \"<FRAMEWORK_1>.framework does not support provisioning profiles.\"

UserInfo={NSLocalizedDescription=<FRAMEWORK_1>.framework does not support provisioning profiles.,

NSLocalizedRecoverySuggestion=<FRAMEWORK_1>.framework does not support provisioning profiles,

but provisioning profile <MY_VALID_PROVISIONING_PROFILE> has been manually specified.

Remove this item from the \"provisioningProfiles\" dictionary in your Export Options property list.}",


"Error Domain=IDEProvisioningErrorDomain Code=10 \"<FRAMEWORK_1>.framework does not support provisioning profiles.\" UserInfo={NSLocalizedDescription=<FRAMEWORK_1>.framework does not support provisioning profiles., NSLocalizedRecoverySuggestion=<FRAMEWORK_1>.framework does not support provisioning profiles, but provisioning profile <MY_VALID_PROVISIONING_PROFILE> has been manually specified. Remove this item from the \"provisioningProfiles\" dictionary in your Export Options property list.}",

"Error Domain=IDEProvisioningErrorDomain Code=10 \"<FRAMEWORK_2>.framework does not support provisioning profiles.\" UserInfo={NSLocalizedDescription=<FRAMEWORK_2>.framework does not support provisioning profiles., NSLocalizedRecoverySuggestion=<FRAMEWORK_2>.framework does not support provisioning profiles, but provisioning profile <MY_VALID_PROVISIONING_PROFILE> has been manually specified. Remove this item from the \"provisioningProfiles\" dictionary in your Export Options property list.}",

"Error Domain=IDEProvisioningErrorDomain Code=10 \"<FRAMEWORK_3>.framework does not support provisioning profiles.\" UserInfo={NSLocalizedDescription=<FRAMEWORK_3>.framework does not support provisioning profiles., NSLocalizedRecoverySuggestion=<FRAMEWORK_3>.framework does not support provisioning profiles, but provisioning profile <MY_VALID_PROVISIONING_PROFILE> has been manually specified. Remove this item from the \"provisioningProfiles\" dictionary in your Export Options property list.}",

"Error Domain=IDEProvisioningErrorDomain Code=10 \"<FRAMEWORK_4>.framework does not support provisioning profiles.\" UserInfo={NSLocalizedDescription=<FRAMEWORK_4>.framework does not support provisioning profiles., NSLocalizedRecoverySuggestion=<FRAMEWORK_4>.framework does not support provisioning profiles, but provisioning profile <MY_VALID_PROVISIONING_PROFILE> has been manually specified. Remove this item from the \"provisioningProfiles\" dictionary in your Export Options property list.}",

"Error Domain=IDEProvisioningErrorDomain Code=10 \"<FRAMEWORK_5>.framework does not support provisioning profiles.\" UserInfo={NSLocalizedDescription=<FRAMEWORK_5>.framework does not support provisioning profiles., NSLocalizedRecoverySuggestion=<FRAMEWORK_5>.framework does not support provisioning profiles, but provisioning profile <MY_VALID_PROVISIONING_PROFILE> has been manually specified. Remove this item from the \"provisioningProfiles\" dictionary in your Export Options property list.}"

)}


```


In Xcode 9, there appears a need to define provisioning profiles in the "exportOptionsPlist" file. (file: <<MY_APP>-9.9.99.plist> )


If you leave the section "<key>provisioningProfiles</key>" in, you get the errors above.


If you take it out as suggested, you get a second error:


```

$ /usr/bin/xcodebuild -exportArchive -archivePath "./build/development/<MY_APP>.xcarchive" -exportPath "./build/development/Signed" -exportOptionsPlist "./build/development/<MY_APP>-9.9.99.plist"


2018-01-29 00:52:02.547 xcodebuild[44872:1118644] [MT] IDEDistribution:

-[IDEDistributionLogging _createLoggingBundleAtPath:]:

Created bundle at path '/var/folders/bp/9886401s3l36_z01xnghn6180000gn/T/<MY_APP>_2018-01-29_00-52-02.545.xcdistributionlogs'.


2018-01-29 00:52:03.970 xcodebuild[44872:1118644] [MT] IDEDistribution:

Step failed: <IDEDistributionSigningAssetsStep: 0x7fa381dbdf70>:

Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed."

UserInfo={NSLocalizedDescription=Locating signing assets failed.,

IDEDistributionSigningAssetStepUnderlyingErrors=(

"Error Domain=IDEProvisioningErrorDomain Code=9 \"\"<MY_APP>.app\" requires a provisioning profile with the Push Notifications feature.\" UserInfo={NSLocalizedDescription=\"<MY_APP>.app\" requires a provisioning profile with the Push Notifications feature., NSLocalizedRecoverySuggestion=Add a profile to the \"provisioningProfiles\" dictionary in your Export Options property list.}"

)}

error: exportArchive: "<MY_APP>.app" requires a provisioning profile with the Push Notifications feature.


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


** EXPORT FAILED **


```

So, this is what I've tried:


- validated the fields in the exportOptionsPlist file ($ xcodebuild -h // gives the options) and made sure there's an entry in the plist for most if not all options.

- removed the section -- and this causes an error where xcode says it needs a provisioning profile with a Push Notification entitlement. -- so I put it back in.

- changed the <key>signingStyle</key> to {manual | automatic} -- same response.

- googled (for hours) on "Error Domain=IDEProvisioningErrorDomain Code=10", "framework does not support provisioning profiles", etc .. no strong hits ..


Now, I **CAN** build via the Xcode IDE and produce an Archive and export an IPA. One of the articles I googled suggested taking the output of the succesful export's "ExportOptions.plist" file and then copying the internals of it into the plist used to do the manual signing. -- Same failure (although I did pick up some good example additional settings and values)


So -- I'm stuck ..


- I cant find any definitive answers for the "IDEProvisioningErrorDomain Code=10" error.

- I can build, archive, and export manually in the IDE, I can BUILD and ARCHIVE from the command line, I cannot EXPORT from the command line.


Looking for recommendations, Your thoughts are welcomed.


Mike

Did you ever find a solution to this? We're seeing this suddenly (seemingly after a Cocoapods update but it's hard to tell).

Please refer to my answer here. Hope it will help.

Did you find a solution to this one? We are hitting this problem right now. Did absolutely everything that you did and came to the same conclusions. And now we are stuck also :/

Xcode 9 XCODEBUILD exportArchive errors
 
 
Q