Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

xcodebuild -exportArchive rejects the method key in exportOptions.plist

Errorerror: exportOptionsPlist error for key 'method': expected one of {}

Short answer

xcodebuild accepts only the method values that fit the archive type. Use app-store-connect, release-testing, enterprise or debugging instead of the deprecated app-store, ad-hoc and development. If the list of allowed values is empty, the archive holds no exportable app, so check the build and archive steps.

  • Applies to Xcode 26, xcodebuild, macOS 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print the options xcodebuild documents for the export plist, then read the method line. Compare it with the value in your plist.

    xcodebuild -help | grep -A 3 "method : String"
    /usr/libexec/PlistBuddy -c "Print :method" exportOptions.plist
  2. 2Match what you see, then jump to its fix

    1. 1The plist uses app-store, ad-hoc or development, a typo, or a value for another platformThe method value is not one xcodebuild accepts for this archiveFix
    2. 2expected one of {} with an empty setThe archive has no app inside, so no method is validFix
    3. 3The path is a build folder, a missing file or an older archive-archivePath points at something the archive action did not produceFix

What does the error look like?

  • error: exportOptionsPlist error for key 'method': expected one of {}
  • xcodebuild: error: exportArchive: exportOptionsPlist error for key

Cause 1 of 3

The method value is not one xcodebuild accepts for this archive

1Check

xcodebuild -help lists the valid values: app-store-connect, release-testing, enterprise, debugging, developer-id, mac-application and validation. The list depends on the archive type. app-store, ad-hoc and development are marked deprecated there.

/usr/libexec/PlistBuddy -c "Print :method" exportOptions.plist

2Fix

Set the current name that matches your goal: app-store-connect for the store or TestFlight, release-testing for ad hoc builds, debugging for development builds.

/usr/libexec/PlistBuddy -c "Set :method app-store-connect" exportOptions.plist

3Verify

Run the export again.

xcodebuild -exportArchive -archivePath MyApp.xcarchive \
  -exportPath build/export -exportOptionsPlist exportOptions.plist

Confirmed by developer.apple.com

Did this fix it?

Cause 2 of 3

The archive has no app inside, so no method is valid

1Check

The valid list varies with the archive type. An app target with Skip Install set to YES is not installed into the archive, so the archive has nothing to export.

xcodebuild -showBuildSettings -scheme MyApp | grep SKIP_INSTALL

2Fix

Set Skip Install to NO on the app target for the Release configuration (Skip Install is YES only for helper targets such as embedded frameworks), then archive again.

xcodebuild archive -scheme MyApp -configuration Release -archivePath MyApp.xcarchive

3Verify

Export the new archive.

xcodebuild -exportArchive -archivePath MyApp.xcarchive \
  -exportPath build/export -exportOptionsPlist exportOptions.plist

Confirmed by developer.apple.com

Did this fix it?

Cause 3 of 3

-archivePath points at something the archive action did not produce

1Check

The man page says -archivePath is the archive produced by the archive action, or the archive to export. A normal build does not create one.

ls -d MyApp.xcarchive
man xcodebuild | col -b | grep -n -A 3 "archivePath xcarchivepath"

2Fix

Create the archive with the archive action first, then pass that same path to -exportArchive.

xcodebuild archive -workspace MyApp.xcworkspace -scheme MyApp \
  -archivePath MyApp.xcarchive

3Verify

The export step runs against the new archive.

xcodebuild -exportArchive -archivePath MyApp.xcarchive \
  -exportPath build/export -exportOptionsPlist exportOptions.plist

Confirmed by developer.apple.com

Did this fix it?

How do I stop it coming back?

  • Keep exportOptions.plist in the repository next to the CI script, and update method when you update Xcode.
  • Print xcodebuild -help in CI logs so a changed list of values is visible.
  • Run archive and exportArchive as two steps against one explicit archive path.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Mobile apps

App record creation fails because you lack permission

You cannot add a new app in App Store Connect as a Developer or limited user

Only the Account Holder, an Admin or an App Manager can create an app record, and Apple blocks it until the Account Holder has signed the latest agreement.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.