Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Xcode 7 export archive error #89

Closed
SpacyRicochet opened this issue Sep 19, 2015 · 43 comments
Closed

Xcode 7 export archive error #89

SpacyRicochet opened this issue Sep 19, 2015 · 43 comments
Labels

Comments

@SpacyRicochet
Copy link

I'm trying to build a ad hoc version. After upgrading to Xcode 7, my fastlane setup gives me the following error during gym:

error: exportArchive: exportOptionsPlist error for key 'method': expected one of {}, but found app-store

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

The only reference I can find to this on the inter webs is to a now lost Apple Dev Forums discussion. Anyone else have an idea?

@SpacyRicochet SpacyRicochet changed the title Xcode 7 export archive error: Xcode 7 export archive error Sep 19, 2015
@SpacyRicochet
Copy link
Author

While I don't understand why the command expects {} instead of a string, I see that the value app-store is hardcoded instead of, for example, ad-hoc, as mentioned in xcodebuild -help.

method : String
Describes how Xcode should export the archive. Available options: app-store, package, ad-hoc, enterprise, development, and developer-id. The list of options varies based on the type of archive. Defaults to development.

Shouldn't this be dynamic, depending on the type of build?

@KrauseFx
Copy link
Contributor

Shouldn't this be dynamic, depending on the type of build?

Very good point. I don't think there is an automatic way to detect the type, so this should be a user parameter.

@KrauseFx
Copy link
Contributor

I just pushed https://github.com/fastlane/gym/releases/tag/0.7.0 let me know what you think

@KrauseFx
Copy link
Contributor

I don't know how to solve the original issue, but there is a radar for that https://openradar.appspot.com/radar?id=4952000420642816

@phatblat
Copy link

I'm getting that same message in a project using plain xcodebuild.
http://openradar.appspot.com/radar?id=4952000420642816

@phatblat
Copy link

So, not an issue with gym, but rather with xcodebuild

@SpacyRicochet
Copy link
Author

@KrauseFx: 0.7.0 works well, except that it still doesn't build.

While gym in isolation probably can't figure out what the type of build is, it should be able to make an educated guess when it's a part of a lane. For example, when I create and provide an 'ad-hoc' profile with sigh, gym can be fed the 'ad-hoc' option.

With enterprise it could be more difficult, since you would have to read the actual profile to determine the type.

@SpacyRicochet
Copy link
Author

About the bug; since it's an xcodebuild issue, how are people currently creating Xcode 7 archives with gym? Using GMs, or just by omitting the entire exportOptionsPlist?

Duplicated that radar and opened an Apple Dev Forum discussion: https://forums.developer.apple.com/message/59201#59201 (still in moderation, currently)

@KrauseFx
Copy link
Contributor

@SpacyRicochet Good point, the easiest way is to re-use the option that is used in sigh, as the user specifies the profile type.

About the bug; since it's an xcodebuild issue, how are people currently creating Xcode 7 archives with gym? Using GMs, or just by omitting the entire exportOptionsPlist?

It's working great on my machine, also you and @phatblat were to only ones reporting this issue (maybe that's because it's weekend)

If more people run into this issue it might make sense to add a flag to disable the new method of exporting ipa files and fallback to the old way.

@SpacyRicochet
Copy link
Author

I might have found a clue; it's currently not possible to build an appropriate archive with Xcode's 'Archive' option either. Because I recently switched from using embedded frameworks in CocoaPods to not doing that (iOS 7 support), it might still have some kind of headers stuck at public which will kill the archives.

Will create a new project setup and report back on whether that fixes the issue.

@SpacyRicochet
Copy link
Author

Fixed the method = {} issue by removing cocoa pods 0.39.x beta and installing the stable 0.38.2 version instead. After that, I did a fresh 'pod install' and archiving now works with Xcode. Gym now fails on other issues instead :)

2015-09-21 10:57:20.808 xcodebuild[33088:407706] [MT] IDEDistribution: -[IDEDistributionProvisioning _itemToSigningInfoMap:]: Can't find any applicable signing identities for items: (
"<IDEDistributionItem: 0x7fb073369050 'com.plugwise.thermo.beta' '<DVTFilePath:0x7fb07332dd80:'/Users/brunoscheele/Library/Developer/Xcode/Archives/2015-09-21/awesome-app-ios-swift 2015-09-21 10.56.27.xcarchive/Products/Applications/awesome-app-ios-swift.app'>'>",

<snipped>

Errors={
"<DVTSigningCertificate: 0x7fb074421fb0; name='iPhone Distribution: Company B.V. (XXXXXXX)', hash='0C3493A05FFE756D8A3A0222EAFE9829E225A79C', certificateKind='1.2.840.113635.100.6.1.4'>" =     {
"<IDEDistributionItem: 0x7fb073369050 'com.noodlewerk.awesome-app-ios.beta' '<DVTFilePath:0x7fb07332dd80:'/Users/brunoscheele/Library/Developer/Xcode/Archives/2015-09-21/awesome-app-ios-swift 2015-09-21 10.56.27.xcarchive/Products/Applications/awesome-app-ios-swift.app'>'>" = "Error Domain=DVTCodesignResolverErrorDomain Code=7 \"No matching provisioning profiles found\" UserInfo=0x7fb0733c5f40 {NSLocalizedRecoverySuggestion=None of the valid provisioning profiles allowed the specified entitlements: application-identifier, beta-reports-active, keychain-access-groups., NSLocalizedDescription=No matching provisioning profiles found, DVTCodesignResolverError_ResolutionInputsKey=<DVTCodesignResolutionInputs: 0x7fb07442fa30; portalTeamID='ZD42GVTV43', usingTeamBasedSigning='NO', bundleIdentifier='com.noodlewerk.awesome-app-ios.beta', targetName='(null)', provisioningProfileType='1', requiresProvisioningProfile='YES', provisioningProfilePlatform='ios', certificateKind='1.2.840.113635.100.6.1.4', requiredEntitlements='{\n    \"application-identifier\" = \"XXXXXXX.com.noodlewerk.awesome-app-ios.beta\";\n    \"beta-reports-active\" = 1;\n    \"keychain-access-groups\" =     (\n        \"XXXXXXX.com.noodlewerk.awesome-app-ios.beta\"\n    );\n}', requiredCodesignableDevices='(null)', requiredFeatures='(null)'>\n}";
};
}

@staminajim
Copy link

Chiming in that this has started happening to me after upgrading from fastlane 1.26.0 to 1.27.0. The gym dependency updated from 0.5.0 to 0.7.0.

No change in the Xcode installation (Xcode 7 final).

I'll see if I can pin it down to the fastlane core or gym update.

@SpacyRicochet
Copy link
Author

Extra tidbits;

  • One of the suggestions from the 'Xcode 6 is new' era was to make a new project file and to rebuild the entire project. Done that, but it still gives me the same issue.
  • Xcode's Archive options works perfectly, though it gives me a humongous file (42MB, as opposed to fastlane's 8MB).

@staminajim
Copy link

Probably expected since gym 0.6.x is when the archive export feature changed but:

fastlane 1.26.0 + gym 0.5.0 = OK
fastlane 1.27.0 + gym 0.6.2 = exportOptionsPlist error.

If you anyone needs to pin your gems until this is resolved.

@dev-mush
Copy link

Unfortunately, updating the gym gem to the latest I'm having the same problem that @SpacyRicochet is having.

@KrauseFx
Copy link
Contributor

Are you using enterprise distribution?

Possibly related #90 (comment)?

How does your Ruby environment look like? System Ruby, rbenv or rvm?

@sp3esu
Copy link

sp3esu commented Sep 21, 2015

Hi @KrauseFx.
I think I have same issue:

2015-09-21 19:22:53.505 xcodebuild[25965:1541484] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/n6/lqq5qmn93rd0h25t920csb280000gn/T/APP_NAME_WAS_HERE_2015-09-21_19-22-53.505.xcdistributionlogs'.
error: exportArchive: exportOptionsPlist error for key 'method': expected one of {}, but found ad-hoc

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

OS X 10.10.5, System Ruby, XCode 7

gym(
      workspace: "WORKSPACE_NAME.xcworkspace",
      provisioning_profile_path: ENV["PROJECT_PROVISIONING_PATH"],
      configuration: "Ad Hoc",
      scheme: "SCHEME_NAME",
      export_method: 'ad-hoc',
      silent: false,
      clean: true,
      output_directory: "build",
      output_name: "IPA_NAME.ipa",      
      sdk: "iphoneos9.0"
    )

All signing stuff is configured correctly. I can easly use archive builded by gym with Crashlytics and distribute it.

@staminajim
Copy link

@KrauseFx I'm not using enterprise distribution, and using bundler with system ruby.

@SpacyRicochet
Copy link
Author

@dev-mush Are you having the method {} issue or the entitlements issue? We probably should separate the issues.
@staminajim Can you perform a normal archive with Xcode and does that give you an actual 'iOS app archive', as opposed to a 'generic Xcode archive'?

@staminajim
Copy link

@SpacyRicochet You can make a proper archive in Xcode if you delete the Copy Bundle Resources build phase from the app extension target.

Sorry I'm not at a build machine at the moment to see if incorporating that step into the fastlane script might work as a workaround.

@dev-mush
Copy link

@SpacyRicochet I'm having the entitlements issue (the second one you posted, just to be more precise).

For clarity, here's the full output (quite big) along with the error log. I'm trying to dig into it a little despite my knowledge of ruby is quite limited.

-----
-----

[17:09:25]: Successfully stored the archive. You can find it in the Xcode Organizer.
[17:09:25]: /usr/bin/xcrun xcodebuild -exportArchive -exportOptionsPlist '/tmp/gym_config_1442848165.plist' -archivePath '/Users/distiller/Library/Developer/Xcode/Archives/2015-09-21/MyAppName 2015-09-21 17.07.25.xcarchive' -exportPath '/tmp/1442848165' 
2015-09-21 17:09:26.025 xcodebuild[25374:37757] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/jm/fw86rxds0xn69sk40d18y69m0000gp/T/MyAppName_2015-09-21_17-09-26.024.xcdistributionlogs'.
2015-09-21 17:09:26.378 xcodebuild[25374:37757] [MT] IDEDistribution: -[IDEDistributionProvisioning _itemToSigningInfoMap:]: Can't find any applicable signing identities for items: (
"<IDEDistributionItem: 0x7fceaa29be40 'com.MyAppName.iPhoneApp.beta' '<DVTFilePath:0x7fceaa2a7bc0:'/Users/distiller/Library/Developer/Xcode/Archives/2015-09-21/MyAppName 2015-09-21 17.07.25.xcarchive/Products/Applications/MyAppName.app'>'>"
)
Errors={
"<DVTSigningCertificate: 0x7fceaa449770; name='iPhone Distribution: MyAppName s.r.l. (xxxTeamIdxxx)', hash='9449091287611E7F60EA6BF596CEA8F299E2F28F', certificateKind='1.2.840.113635.100.6.1.4'>" =     {
"<IDEDistributionItem: 0x7fceaa29be40 'com.MyAppName.iPhoneApp.beta' '<DVTFilePath:0x7fceaa2a7bc0:'/Users/distiller/Library/Developer/Xcode/Archives/2015-09-21/MyAppName 2015-09-21 17.07.25.xcarchive/Products/Applications/MyAppName.app'>'>" = "Error Domain=DVTCodesignResolverErrorDomain Code=7 \"No matching provisioning profiles found\" UserInfo=0x7fceaa472ae0 {NSLocalizedRecoverySuggestion=None of the valid provisioning profiles allowed the specified entitlements: application-identifier, beta-reports-active, keychain-access-groups., NSLocalizedDescription=No matching provisioning profiles found, DVTCodesignResolverError_ResolutionInputsKey=<DVTCodesignResolutionInputs: 0x7fceaa70f020; portalTeamID='xxxTeamIdxxx', usingTeamBasedSigning='NO', bundleIdentifier='com.MyAppName.iPhoneApp.beta', targetName='(null)', provisioningProfileType='1', requiresProvisioningProfile='YES', provisioningProfilePlatform='ios', certificateKind='1.2.840.113635.100.6.1.4', requiredEntitlements='{\n    \"application-identifier\" = \"xxxTeamIdxxx.com.MyAppName.iPhoneApp.beta\";\n    \"beta-reports-active\" = 1;\n    \"keychain-access-groups\" =     (\n        \"xxxTeamIdxxx.com.MyAppName.iPhoneApp.beta\"\n    );\n}', requiredCodesignableDevices='(null)', requiredFeatures='(null)'>\n}";
};
}
2015-09-21 17:09:26.380 xcodebuild[25374:37757] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7fceaa23e3e0>: Error Domain=IDEDistributionErrorDomain Code=3 "The operation couldn’t be completed. (IDEDistributionErrorDomain error 3.)" UserInfo=0x7fceaa472bd0 {IDEDistributionErrorSigningIdentityToItemToUnderlyingErrorKey={
"<DVTSigningCertificate: 0x7fceaa449770; name='iPhone Distribution: MyAppName s.r.l. (xxxTeamIdxxx)', hash='9449091287611E7F60EA6BF596CEA8F299E2F28F', certificateKind='1.2.840.113635.100.6.1.4'>" =     {
"<IDEDistributionItem: 0x7fceaa29be40 'com.MyAppName.iPhoneApp.beta' '<DVTFilePath:0x7fceaa2a7bc0:'/Users/distiller/Library/Developer/Xcode/Archives/2015-09-21/MyAppName 2015-09-21 17.07.25.xcarchive/Products/Applications/MyAppName.app'>'>" = "Error Domain=DVTCodesignResolverErrorDomain Code=7 \"No matching provisioning profiles found\" UserInfo=0x7fceaa472ae0 {NSLocalizedRecoverySuggestion=None of the valid provisioning profiles allowed the specified entitlements: application-identifier, beta-reports-active, keychain-access-groups., NSLocalizedDescription=No matching provisioning profiles found, DVTCodesignResolverError_ResolutionInputsKey=<DVTCodesignResolutionInputs: 0x7fceaa70f020; portalTeamID='xxxTeamIdxxx', usingTeamBasedSigning='NO', bundleIdentifier='com.MyAppName.iPhoneApp.beta', targetName='(null)', provisioningProfileType='1', requiresProvisioningProfile='YES', provisioningProfilePlatform='ios', certificateKind='1.2.840.113635.100.6.1.4', requiredEntitlements='{\n    \"application-identifier\" = \"xxxTeamIdxxx.com.MyAppName.iPhoneApp.beta\";\n    \"beta-reports-active\" = 1;\n    \"keychain-access-groups\" =     (\n        \"xxxTeamIdxxx.com.MyAppName.iPhoneApp.beta\"\n    );\n}', requiredCodesignableDevices='(null)', requiredFeatures='(null)'>\n}";
};
}}
error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomain error 3.)

Error Domain=IDEDistributionErrorDomain Code=3 "The operation couldn’t be completed. (IDEDistributionErrorDomain error 3.)" UserInfo=0x7fceaa472bd0 {IDEDistributionErrorSigningIdentityToItemToUnderlyingErrorKey={
"<DVTSigningCertificate: 0x7fceaa449770; name='iPhone Distribution: MyAppName s.r.l. (xxxTeamIdxxx)', hash='9449091287611E7F60EA6BF596CEA8F299E2F28F', certificateKind='1.2.840.113635.100.6.1.4'>" =     {
"<IDEDistributionItem: 0x7fceaa29be40 'com.MyAppName.iPhoneApp.beta' '<DVTFilePath:0x7fceaa2a7bc0:'/Users/distiller/Library/Developer/Xcode/Archives/2015-09-21/MyAppName 2015-09-21 17.07.25.xcarchive/Products/Applications/MyAppName.app'>'>" = "Error Domain=DVTCodesignResolverErrorDomain Code=7 \"No matching provisioning profiles found\" UserInfo=0x7fceaa472ae0 {NSLocalizedRecoverySuggestion=None of the valid provisioning profiles allowed the specified entitlements: application-identifier, beta-reports-active, keychain-access-groups., NSLocalizedDescription=No matching provisioning profiles found, DVTCodesignResolverError_ResolutionInputsKey=<DVTCodesignResolutionInputs: 0x7fceaa70f020; portalTeamID='xxxTeamIdxxx', usingTeamBasedSigning='NO', bundleIdentifier='com.MyAppName.iPhoneApp.beta', targetName='(null)', provisioningProfileType='1', requiresProvisioningProfile='YES', provisioningProfilePlatform='ios', certificateKind='1.2.840.113635.100.6.1.4', requiredEntitlements='{\n    \"application-identifier\" = \"xxxTeamIdxxx.com.MyAppName.iPhoneApp.beta\";\n    \"beta-reports-active\" = 1;\n    \"keychain-access-groups\" =     (\n        \"xxxTeamIdxxx.com.MyAppName.iPhoneApp.beta\"\n    );\n}', requiredCodesignableDevices='(null)', requiredFeatures='(null)'>\n}";
};
}}

** EXPORT FAILED **
[17:09:26]: Exit status: 70
[17:09:26]: Variable Dump:
[17:09:26]: {:DEFAULT_PLATFORM=>:ios, :ENVIRONMENT=>nil, :PLATFORM_NAME=>:ios, :LANE_NAME=>"ios beta"}
[17:09:26]: Error packaging up the application

+------+--------------------------------------+-------------+
|                     fastlane summary                      |
+------+--------------------------------------+-------------+
| Step | Action                               | Time (in s) |
+------+--------------------------------------+-------------+
| 1    | Verifying required fastlane version  | 0           |
| 2    | default_platform                     | 0           |
| 3    | ./scripts/build-release-notes.sh     | 0           |
| 4    | ./scripts/setup-version-and-build.sh | 0           |
| 5    | ./scripts/add-keychain-items.sh      | 0           |
| 6    | gym                                  | 124         |
+------+--------------------------------------+-------------+

[17:09:26]: fastlane finished with errors
/Library/Ruby/Gems/2.0.0/gems/gym-0.7.0/lib/gym/error_handler.rb:84:in `handle_package_error': Error packaging up the application (RuntimeError)
    from /Library/Ruby/Gems/2.0.0/gems/gym-0.7.0/lib/gym/runner.rb:103:in `block in package_app'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane_core-0.17.1/lib/fastlane_core/command_executor.rb:51:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane_core-0.17.1/lib/fastlane_core/command_executor.rb:51:in `execute'
    from /Library/Ruby/Gems/2.0.0/gems/gym-0.7.0/lib/gym/runner.rb:99:in `package_app'
    from /Library/Ruby/Gems/2.0.0/gems/gym-0.7.0/lib/gym/runner.rb:16:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/gym-0.7.0/lib/gym/manager.rb:8:in `work'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/actions/gym.rb:20:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/runner.rb:142:in `block (2 levels) in execute_action'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/actions/actions_helper.rb:37:in `execute_action'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/runner.rb:128:in `block in execute_action'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/runner.rb:127:in `chdir'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/runner.rb:127:in `execute_action'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/fast_file.rb:134:in `method_missing'
    from (eval):33:in `block (3 levels) in parse'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/lane.rb:36:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/lane.rb:36:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/runner.rb:51:in `block in execute'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/runner.rb:46:in `chdir'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/runner.rb:46:in `execute'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/lane_manager.rb:43:in `cruise_lane'

    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/lib/fastlane/command_line_handler.rb:31:in `handle'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/bin/fastlane:36:in `block (2 levels) in run'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:68:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/bin/fastlane:127:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.27.0/bin/fastlane:133:in `<top (required)>'
    from /usr/bin/fastlane:23:in `load'

fastlane beta returned exit code 1

from /usr/bin/fastlane:23:in `<main>' Action failed: fastlane beta

Hope this helps.

@KrauseFx
Copy link
Contributor

I just pushed a new release https://github.com/fastlane/gym/releases/tag/0.7.1, basically you can fallback to the old way of code signing using the use_legacy_build_api option.

@KrauseFx
Copy link
Contributor

@dev-mush your error message is

None of the valid provisioning profiles allowed the specified entitlements: application-identifier, beta-reports-active, keychain-access-groups., NSLocalizedDescription=No matching provisioning profiles found

Have you followed the code signing guide?

@dev-mush
Copy link

mmmmh @KrauseFx no, I didn't follow any specific guide that I have memory of... I'm configuring the keychain on the ci-server (circle) with a shell script, importing the certificates, and the provisioning profiles settings via xcode.
Of course I will look for this guide instantly! Meanwhile if you can, a link would be really appreciated, thanks :) !

edit:

found it here: https://github.com/KrauseFx/fastlane/blob/master/docs/CodeSigning.md I'll give it a look tomorrow morning and let you know

@KrauseFx
Copy link
Contributor

Thanks @dev-mush, the code signing guide should help you 👍

@SpacyRicochet
Copy link
Author

@KrauseFx @dev-mush Following the guide doesn't seem to be working for me. Just to be sure, this is the relevant part of my Fastfile:

    cert

    # Get provisioning profile (and update if necessary)
    sigh(
        adhoc: true
    )
    ENV["PROFILE_UDID"] = lane_context[SharedValues::SIGH_UDID]

    # Build and sign
    gym(
        workspace: "awesome-app-ios-swift.xcworkspace",
        configuration: "Release",
        scheme: "awesome-app-ios-swift"
    )

and this shows how my Code Signing in Xcode looks for the appropriate target.

screen shot 2015-09-22 at 11 05 39

Are those correct?

@dev-mush
Copy link

Yup, I'm in the same boat...I'll try with two other things that came to my mind and then I'll try to opt in with sigh...otherwise I'll just rollback to the previous version of fastlane since it was working out ok.

@SpacyRicochet
Copy link
Author

@staminajim's setup works for me now.

fastlane 1.26.0 + gym 0.5.0 = OK

Reverted back to that for now.

@KrauseFx
Copy link
Contributor

@SpacyRicochet Yes, that looks fine.

You don't have to downgrade fastlane, instead use the use_legacy_build_api option to switch back to the previous method of code signing

@SpacyRicochet
Copy link
Author

use_legacy_build_api works like a charm.

To summarize;

  • The method {} radar still isn't solved, but is likely caused when you shouldn't be able to build a proper 'iOS App Archive' anyway. Fixing that should also fix being able to build with the latest gym without legacy support and if not, we can use use_legacy_build_api.
  • The 'missing entitlements' issue is still a mystery, but is solved by using the use_legacy_build_api option.

Since we have solutions for both issues, shall we close this issue?

@staminajim
Copy link

If you go down the CocoaPods github wormhole from here: CocoaPods/CocoaPods#4021 it looks like this issue might go away once CocoaPods 0.39 goes final.

@KrauseFx Thanks for the use_legacy_build_api gym option 👍

@ide
Copy link
Contributor

ide commented Oct 9, 2015

@staminajim I upgraded to CocoaPods 0.39.0-rc.1 and no luck even with export_method: "enterprise". I kind of suspect Ruby (or maybe a new version of gym) in my case since I deleted and re-installed all my gems yesterday and Enterprise builds stopped working today. I could still create an Enterprise IPA successfully with Xcode or with use_legacy_build_api.

@phatblat
Copy link

FWIW, the issues I had with -exportOptionsPlist were caused by CocoaPods 0.38.2, resolved in 0.39.
http://openradar.appspot.com/radar?id=4952000420642816

@KrauseFx
Copy link
Contributor

That's good news, thanks for porting it @phatblat 👍

@linktoming
Copy link

In my case, I just replace ipa with gym as the console output suggested, but the new script with gym got the above error while ipa wouldn't.

My Fastfile with real value masted out.

 gym(
      workspace: ...
      configuration: ...
      scheme: ...,
    )
 crashlytics( ... )

Is it required to use sign before gym?

@KrauseFx
Copy link
Contributor

@linktoming You should use match for codesigning.

@skywinder
Copy link

Same issue as @dev-mush the recap:

>gym -s AwesomeApp-beta -q Beta
...
▸ Archive Succeeded
[10:49:16]: Successfully stored the archive. You can find it in the Xcode Organizer.
...
-> start to export:
...
error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomain error 3.)

Error Domain=IDEDistributionErrorDomain Code=3 "The operation couldn’t be completed. (IDEDistributionErrorDomain error 3.)"

...

** EXPORT FAILED **
[10:49:17]: Exit status: 70

Same archive export with xcode got this error:
screen_shot_2015-12-24_at_11_07_34

So, the problem was in HealthKit. I enable it via produce:

produce enable_services --healthkit

Right after the old provisions becomes invalid.

So you have to recreate provisions:

match nuke development

And create them again:

match development

After that everything is works fine!
Hope it helps!

@zinthemoney
Copy link

adding use_legacy_build_api: true to gym also worked for me.

@lacostej
Copy link
Contributor

lacostej commented Jan 7, 2016

For those running into issues while using the new export API, the #178 PR should help troubleshooting things further as it appends the standard xcodebuild output to the gym build output.

@rammangai87
Copy link

The reason is the method parameter in the exportOptions.plist should exactly match the type of provisioning profile which is used to codesign the Archive.

Ex: If it is an enterprise profile - then the value of method should be enterprise. The Same applies for app-store as well.

A quick note - If our application has swift files in it - the exportarchive produces SwiftSupport folder only in case of app-store method in exportOptions.plist. If you provide enterprise, it wont include the folder in the resulting ipa.

@hjanuschka
Copy link

in my case it seems to be an outdated WWDR cert.
got the new one from https://www.apple.com/certificateauthority/
and my distr. certs showed up green again and solved the issue

@deberle
Copy link

deberle commented Feb 16, 2016

Same for me.
Check this SO post: http://stackoverflow.com/a/35401483/921573.

@fastlane-bot-helper
Copy link

This issue was migrated to fastlane/fastlane#1855. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests