Xcode7 (7A220): xcodebuild -exportArchive with new -exportOptionsPlist option chokes on 'method' key in plist

Originator:benchatelain
Number:rdar://22740827 Date Originated:17-Sep-2015 11:17 AM
Status:Dup of 22500363 Resolved:
Product:Developer Tools Product Version:Xcode7 (7A220)
Classification:Serious Bug Reproducible:Always
 
Summary:
Providing the -exportOptionsPlist option to the xcodebuild command with a plist file always fails with a message about the ‘method’ key, whether it is present or not.

Steps to Reproduce:
1. Create an archive using `xcodebuild … archive
2. Run the following command:

    xcodebuild -exportArchive \
        -archivePath "${ARCHIVE_PATH}" \
        -exportPath "${IPA_PATH}" \
        -exportOptionsPlist exportOptionsPlist.plist

Expected Results:
The build will produce an .ipa file according to the export options provided in the given plist.

Actual Results:
If the ‘method’ key is not present in the exportOptionsPlist.plist file:

    2015-09-17 11:12:34.738 xcodebuild[68207:8073058] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/_y/th2_pvnd6zv8pd9cm7ry_c200000gn/T/Release_2015-09-17_11-12-34.738.xcdistributionlogs'.
error: exportArchive: exportOptionsPlist error for key 'method': expected one of {}, but found (null)

    Error Domain=IDEFoundationErrorDomain Code=1 "exportOptionsPlist error for key 'method': expected one of {}, but found (null)" UserInfo=0x7f8d7a587730 {NSLocalizedDescription=exportOptionsPlist error for key 'method': expected one of {}, but found (null)}

    ** EXPORT FAILED **

If the ‘method’ key is present with a valid value documented in `xcodebuild -help` in the exportOptionsPlist.plist file:

    2015-09-17 11:14:20.603 xcodebuild[69463:8085213] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/_y/th2_pvnd6zv8pd9cm7ry_c200000gn/T/Release_2015-09-17_11-14-20.603.xcdistributionlogs'.
error: exportArchive: exportOptionsPlist error for key 'method': expected one of {}, but found enterprise

    Error Domain=IDEFoundationErrorDomain Code=1 "exportOptionsPlist error for key 'method': expected one of {}, but found enterprise" UserInfo=0x7fe72bcebe60 {NSLocalizedDescription=exportOptionsPlist error for key 'method': expected one of {}, but found enterprise}

    ** EXPORT FAILED **


Notes:
https://forums.developer.apple.com/message/56334#56334

Comments

+1

By oleg.shanyuk at Nov. 4, 2016, 10:55 p.m. (reply...)

+1

By spyroszarzonis at Nov. 1, 2016, 8:15 p.m. (reply...)

+1

Having the same issue

+1

Fastlane with use_legacy_build_api works around this, but it's sad that we need to do that.

+1

Is this really still a problem!?! Apple - pull your finger out of playing with new shiny things and get your basic offering fully functional

I really hope I am getting something different, but it does look extremely similar. Is this really Apple sitting on this issue for all this time? I would love to return to direct and conventional execution of the gym gem, I have seen the suggestion that this was fixed with Cocoapods 0.39.0 as long as I re-generate the install with 'pod install', however, I can only assume that maybe this is the way that I 'link_wih; in the header of my Podfile that I believe is a depricated approach with Cocoapods v1.0 as after calling pod install 'gym --use_legacy_build_api' continues to work fine, but running a simple '$ gym' at the command line, I still get this error at the end of my execution:-

[11:12:58]: ▸ Archive Succeeded [11:12:58]: Successfully stored the archive. You can find it in the Xcode Organizer. [11:12:58]: $ /usr/bin/xcrun /Library/Ruby/Gems/2.0.0/gems/gym-1.6.2/lib/assets/wrap_xcodebuild/xcbuild-safe.sh -exportArchive -exportOptionsPlist '/var/folders/rw/hrqw8wt91q7458p_65gvhsrr0000gp/T/gym20160406-13401-1qorbq2_config.plist' -archivePath '/Users/you/Library/Developer/Xcode/Archives/2016-04-06/b*n 2016-04-06 11.06.06.xcarchive' -exportPath '/var/folders/rw/hrqw8wt91q7458p_65gvhsrr0000gp/T/gym20160406-13401-859ceg.gym_output' + xcodebuild -exportArchive -exportOptionsPlist /var/folders/rw/hrqw8wt91q7458p_65gvhsrr0000gp/T/gym20160406-13401-1qorbq2_config.plist -archivePath '/Users/you/Library/Developer/Xcode/Archives/2016-04-06/b*n 2016-04-06 11.06.06.xcarchive' -exportPath /var/folders/rw/hrqw8wt91q7458p_65gvhsrr0000gp/T/gym20160406-13401-859ceg.gym_output 2016-04-06 11:12:58.931 xcodebuild[19499:34385] [MT] IDEDistribution: -[IDEDistributionLogging createLoggingBundleAtPath:]: Created bundle at path '/var/folders/rw/hrqw8wt91q7458p65gvhsrr0000gp/T/B*n_QA3_2016-04-06_11-12-58.930.xcdistributionlogs'. 2016-04-06 11:12:59.050 xcodebuild[19499:34385] [MT] DeveloperPortal: Using pre-existing current store at URL (file:///Users/you/Library/Developer/Xcode/DeveloperPortal%207.3.db). 2016-04-06 11:13:00.305 xcodebuild[19499:34385] [MT] IDEDistribution: Step failed: : Error Domain=IDEDistributionErrorDomain Code=1 "(null)" error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomain error 1.)

Error Domain=IDEDistributionErrorDomain Code=1 "(null)"

EXPORT FAILED [11:13:00]: Exit status: 70

[!] Error packaging up the application

Fixed with CocoaPods 0.39

Turns out that something in the Pods project (generated with 0.38.2) was causing this issue. After regenerating the Pods project using pod install with v0.39, this export command is now working correctly.

By benchatelain at Oct. 12, 2015, 5:12 p.m. (reply...)

Not working

Doesn't seem to work for me. Using 0.39 but still have this error.

+1

By JPinkerton88 at Oct. 6, 2015, 6:13 p.m. (reply...)

+1

By JPinkerton88 at Oct. 6, 2015, 6:13 p.m. (reply...)

+1

Faslane can't work properly. It makes me sad :(

By sky4winder at Oct. 6, 2015, 10:35 a.m. (reply...)

fastlane

If you're using fastlane, you can use the use_legacy_build_api option to use the old way of building + signing until  fixes this issue.

Me too

Very unfriendly error. It turned out the reason for it is that the archive file is a generic archive, not app archive. See http://stackoverflow.com/questions/32841300/xcodebuild-exportarchive-exportoptionsplist-error-for-key-method-expected-o

I'm also seeing this

Is there any fix for this? Apple restricted the access to the forum posting regarding this option. I cannot distribute my build with the -exportOptionsPlist using xcodebuild.

By biran.monkey at Sept. 22, 2015, 12:05 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!