Export archive error for Xcode project containing app clip

470 views Asked by At

We are using Jenkins to automate building of our iOS project. Everything was working just fine out of the box until we integrated App Clip into the Xcode project. The error says (I changed real bundle id):

error: exportArchive: Provide a bundle identifier to select from
available reformatters: com.example.myapp and com.example.myapp.Clip

Error Domain=IDEDistributionReformatterSelectionStepErrorDomain
Code=0 "Provide a bundle identifier to select from available reformatters:
com.example.myapp and com.example.myapp.Clip"

I created ExportOptions.plist and set distributionBundleIdentifier equal to com.example.myapp inside it. Then in Jenkins Advanced Xcode build options -> Custom xcodebuild arguments I added -exportOptionsPlist ExportOptions.plist.

Jenkins asked me to provide -exportArchive additional key. After I did it, Jenkins told that it's illegal to have scheme and exportArchive together in command line.

Does anyone have an idea how to fix it? Thanks.

1

There are 1 answers

0
enoktate On

I encountered the exact same problem with App Clip while trying to use Fastlane for building and uploading my project to Firebase with the ad-hoc export method.

If you use the xcodebuild -help command, you will find an option like this:

distributionBundleIdentifier : String

Reformat archive to focus on eligible target bundle identifier.

To solve the problem, you can add the distributionBundleIdentifier to the -exportOptionsPlist as follows:

<key>distributionBundleIdentifier</key>
<string>com.example.project</string>

For those who are looking for a Fastlane solution, you can add the same key to the export options like this:

gym(
  export_method: "ad-hoc",
  export_options: {
    distributionBundleIdentifier: 'com.example.project'
  }
)

Hope this helps someone.