Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signing error when not using the legacy build option #7717

Closed
2 tasks done
ghost opened this issue Jan 3, 2017 · 17 comments
Closed
2 tasks done

signing error when not using the legacy build option #7717

ghost opened this issue Jan 3, 2017 · 17 comments

Comments

@ghost
Copy link

ghost commented Jan 3, 2017

New Issue Checklist

Issue Description

I updated to Fastlane 2.3.1 recently and now when I tried to build my app with gym using legacy build I get this message: Using deprecated option: '--use_legacy_build_api' (Don't use this option any more, as it's deprecated by Apple)

The app was built fine, but since you are recommending me to stop using --use_legacy_build_api I decided to build my app again without this flag, but I got the following error:

$ /usr/bin/xcrun /usr/local/lib/ruby/gems/2.4.0/gems/fastlane-2.3.1/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh -exportArchive -exportOptionsPlist '/var/folders/_7/qwcb8wy10kvbx049h3wlqjlh0000gn/T/gym_config20170103-6489-tz11sz.plist' -archivePath /Users/vegidio/Library/Developer/Xcode/Archives/2017-01-03/UAN-Safe\(Dev\)\ 2017-01-03\ 08.21.34.xcarchive -exportPath '/var/folders/_7/qwcb8wy10kvbx049h3wlqjlh0000gn/T/gym_output20170103-6489-1y65fy7' -toolchain 'com.apple.dt.toolchain.Swift_2_3'
+ xcodebuild -exportArchive -exportOptionsPlist /var/folders/_7/qwcb8wy10kvbx049h3wlqjlh0000gn/T/gym_config20170103-6489-tz11sz.plist -archivePath '/Users/vegidio/Library/Developer/Xcode/Archives/2017-01-03/UAN-Safe(Dev) 2017-01-03 08.21.34.xcarchive' -exportPath /var/folders/_7/qwcb8wy10kvbx049h3wlqjlh0000gn/T/gym_output20170103-6489-1y65fy7 -toolchain com.apple.dt.toolchain.Swift_2_3
2017-01-03 08:26:40.473 xcodebuild[10096:19273392] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/_7/qwcb8wy10kvbx049h3wlqjlh0000gn/T/uan-develop_2017-01-03_08-26-40.472.xcdistributionlogs'.
1.2.840.113635.100.1.61
2017-01-03 08:26:41.367 xcodebuild[10096:19273392] [MT] IDEDistribution: -[IDEDistributionProvisioning _itemToSigningInfoMap:]: Can't find any applicable signing identities for items: (
"<IDEDistributionItem: 0x7f845df09580 'se.intrasenze.uan.develop' '<DVTFilePath:0x7f845af40d90:'/Users/vegidio/Library/Developer/Xcode/Archives/2017-01-03/UAN-Safe(Dev) 2017-01-03 08.21.34.xcarchive/Products/Applications/UAN-Safe(Dev).app'>'>",
"<IDEDistributionItem: 0x7f845dd26c00 'org.cocoapods.Alamofire' '<DVTFilePath:0x7f845db45e50:'/Users/vegidio/Library/Developer/Xcode/Archives/2017-01-03/UAN-Safe(Dev) 2017-01-03 08.21.34.xcarchive/Products/Applications/UAN-Safe(Dev).app/Frameworks/Alamofire.framework'>'>",
...
)
Errors={
"<DVTSigningCertificate: 0x7f845dd12440; name='iPhone Distribution: Intrasenze AB (4VPJ6KFHHM)', hash='FB3EF1DD934597C72BB68253B48F760A68166F03', serialNumber='2201B0A48CA505EB', certificateKind='1.2.840.113635.100.6.1.4, issueDate='2016-10-26 17:54:25 +0000''>" =     {
"<IDEDistributionItem: 0x7f845df09580 'se.intrasenze.uan.develop' '<DVTFilePath:0x7f845af40d90:'/Users/vegidio/Library/Developer/Xcode/Archives/2017-01-03/UAN-Safe(Dev) 2017-01-03 08.21.34.xcarchive/Products/Applications/UAN-Safe(Dev).app'>'>" = "Error Domain=IDECodesignResolverErrorDomain Code=5 \"No matching provisioning profiles found\" UserInfo={NSLocalizedRecoverySuggestion=No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier \U201cse.intrasenze.uan.develop\U201d were found., NSLocalizedDescription=No matching provisioning profiles found, IDECodesignResolverError_ResolutionInputsKey=<IDECodesignResolutionInputs: 0x7f845e01dcd0; portalTeamID='4VPJ6KFHHM', usingTeamBasedSigning='NO', bundleIdentifier='se.intrasenze.uan.develop', targetName='(null)', provisioningProfilePurpose='1', requiresProvisioningProfile='YES', provisioningProfilePlatform='iOS', certificateKind='1.2.840.113635.100.6.1.4', requiredEntitlements='{\n    \"aps-environment\" = development;\n    \"beta-reports-active\" = 1;\n}', requiredCodesignableDevices='(null)', requiredFeatures='(null)'>\n}";
};
}
2017-01-03 08:26:41.368 xcodebuild[10096:19273392] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7f845aa12e00>: Error Domain=IDEDistributionErrorDomain Code=3 "(null)" UserInfo={IDEDistributionErrorSigningIdentityToItemToUnderlyingErrorKey={
"<DVTSigningCertificate: 0x7f845dd12440; name='iPhone Distribution: Intrasenze AB (4VPJ6KFHHM)', hash='FB3EF1DD934597C72BB68253B48F760A68166F03', serialNumber='2201B0A48CA505EB', certificateKind='1.2.840.113635.100.6.1.4, issueDate='2016-10-26 17:54:25 +0000''>" =     {
"<IDEDistributionItem: 0x7f845df09580 'se.intrasenze.uan.develop' '<DVTFilePath:0x7f845af40d90:'/Users/vegidio/Library/Developer/Xcode/Archives/2017-01-03/UAN-Safe(Dev) 2017-01-03 08.21.34.xcarchive/Products/Applications/UAN-Safe(Dev).app'>'>" = "Error Domain=IDECodesignResolverErrorDomain Code=5 \"No matching provisioning profiles found\" UserInfo={NSLocalizedRecoverySuggestion=No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier \U201cse.intrasenze.uan.develop\U201d were found., NSLocalizedDescription=No matching provisioning profiles found, IDECodesignResolverError_ResolutionInputsKey=<IDECodesignResolutionInputs: 0x7f845e01dcd0; portalTeamID='4VPJ6KFHHM', usingTeamBasedSigning='NO', bundleIdentifier='se.intrasenze.uan.develop', targetName='(null)', provisioningProfilePurpose='1', requiresProvisioningProfile='YES', provisioningProfilePlatform='iOS', certificateKind='1.2.840.113635.100.6.1.4', requiredEntitlements='{\n    \"aps-environment\" = development;\n    \"beta-reports-active\" = 1;\n}', requiredCodesignableDevices='(null)', requiredFeatures='(null)'>\n}";
};
}}
error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomain error 3.)
Error Domain=IDEDistributionErrorDomain Code=3 "(null)" UserInfo={IDEDistributionErrorSigningIdentityToItemToUnderlyingErrorKey={
"<DVTSigningCertificate: 0x7f845dd12440; name='iPhone Distribution: Intrasenze AB (4VPJ6KFHHM)', hash='FB3EF1DD934597C72BB68253B48F760A68166F03', serialNumber='2201B0A48CA505EB', certificateKind='1.2.840.113635.100.6.1.4, issueDate='2016-10-26 17:54:25 +0000''>" =     {
"<IDEDistributionItem: 0x7f845df09580 'se.intrasenze.uan.develop' '<DVTFilePath:0x7f845af40d90:'/Users/vegidio/Library/Developer/Xcode/Archives/2017-01-03/UAN-Safe(Dev) 2017-01-03 08.21.34.xcarchive/Products/Applications/UAN-Safe(Dev).app'>'>" = "Error Domain=IDECodesignResolverErrorDomain Code=5 \"No matching provisioning profiles found\" UserInfo={NSLocalizedRecoverySuggestion=No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier \U201cse.intrasenze.uan.develop\U201d were found., NSLocalizedDescription=No matching provisioning profiles found, IDECodesignResolverError_ResolutionInputsKey=<IDECodesignResolutionInputs: 0x7f845e01dcd0; portalTeamID='4VPJ6KFHHM', usingTeamBasedSigning='NO', bundleIdentifier='se.intrasenze.uan.develop', targetName='(null)', provisioningProfilePurpose='1', requiresProvisioningProfile='YES', provisioningProfilePlatform='iOS', certificateKind='1.2.840.113635.100.6.1.4', requiredEntitlements='{\n    \"aps-environment\" = development;\n    \"beta-reports-active\" = 1;\n}', requiredCodesignableDevices='(null)', requiredFeatures='(null)'>\n}";
};
}}

** EXPORT FAILED **
[08:26:41]: Exit status: 70

Based what I see in the error message, it looks like it is complaining about some distribution signing identify during the archive phase. Just to clarify, my project doesn't have a distribution profile. This is an internal project that we don't have any plan to release in the near future, so we only have a development profile.

When I archive the project manually (using Xcode IDE) or when I build the project using gym with --use_legacy_build_api, this problem doesn't happen. This only happens when I use gym without the legacy build.

Complete output when running fastlane, including the stack trace and command used

You can use: --capture_output as the last commandline argument to get that collected for you

[INSERT OUTPUT HERE]

Environment

Please run fastlane env and copy the output below. This will help us help you 👍
If you used --capture_output option please remove this block - as it is already included there.

🚫 fastlane environment 🚫

Stack

Key Value
OS 10.12.2
Ruby 2.4.0
Bundler? false
Git git version 2.11.0
Installation Source /usr/local/bin/fastlane
Host Mac OS X 10.12.2 (16C67)
Ruby Lib Dir /usr/local/Cellar/ruby/2.4.0/lib
OpenSSL Version OpenSSL 1.0.2j 26 Sep 2016
Is contained false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 8.2.1

System Locale

Error
No Locale with UTF8 found 🚫

fastlane gems

Gem Version Update-Status
fastlane 2.3.1 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.1.0
slack-notifier 1.5.1
CFPropertyList 2.3.4
claide 1.0.1
colored 1.2
nanaimo 0.2.3
xcodeproj 1.4.2
rouge 1.11.1
xcpretty 0.2.4
terminal-notifier 1.7.1
unicode-display_width 1.1.2
terminal-table 1.7.3
plist 3.2.0
public_suffix 2.0.4
addressable 2.5.0
multipart-post 2.0.0
word_wrap 1.0.0
babosa 1.0.2
highline 1.7.8
commander 4.4.3
excon 0.54.0
faraday 0.10.1
unf_ext 0.0.7.2
unf 0.1.4
domain_name 0.5.20161129
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
fastimage 2.0.1
gh_inspector 1.0.2
uber 0.0.15
representable 2.3.0
retriable 2.1.0
mime-types-data 3.2016.0521
mime-types 3.1
hurley 0.2
little-plugger 1.1.4
multi_json 1.12.1
logging 2.1.0
jwt 1.5.6
memoist 0.15.0
os 0.9.6
signet 0.7.3
googleauth 0.5.1
httpclient 2.8.3
google-api-client 0.9.20
json 2.0.2
mini_magick 4.5.1
multi_xml 0.6.0
rubyzip 1.2.0
security 0.1.3
xcpretty-travis-formatter 0.0.4
dotenv 2.1.1
bundler 1.13.7
faraday_middleware 0.10.1
i18n 0.7.0
tzinfo 0.3.52
minitest 4.7.5
thread_safe 0.3.5
activesupport 4.0.13
io-console 0.4.6
openssl 2.0.2

generated on: 2017-01-03

@fastlane-bot
Copy link

It seems like this issue might be related to code signing 🚫

Have you seen our new Code Signing Troubleshooting Guide? It will help you resolve the most common code signing issues 👍

@KrauseFx KrauseFx changed the title Using deprecated option: '--use_legacy_build_api' (Don't use this option any more, as it's deprecated by Apple) signing error when not using the legacy build option Jan 3, 2017
@KrauseFx
Copy link
Member

KrauseFx commented Jan 3, 2017

So since your project doesn't have a distribution certificate, how should it work to build an ipa file? Do you not code sign?

@ghost
Copy link
Author

ghost commented Jan 3, 2017

@KrauseFx We sign with our development certificate. Right now we distribute our app using Crashlytics Beta. We have plans to distribute in the App Store eventually and we will get a distribution certificate, of course, but this will happen in a distant future.

@KrauseFx
Copy link
Member

KrauseFx commented Jan 3, 2017

I don't think you can sign using a development signing identity and then distribute using Crashlytics Beta.

@ghost
Copy link
Author

ghost commented Jan 3, 2017

Well, I currently do that successfully with gym if I use legacy build. I'm only reporting this problem now because I tried to remove the --use_legacy_build_api as suggested by the latest version of gym and I started to get this error.

This project never had a distribution signing identify and I have several builds on Crashlytics Beta that were generated before with legacy build. Are you saying that this is something that Apple changed recently?

@romk1n
Copy link

romk1n commented Jan 3, 2017

have very similar issue everything use to work fine, commented here as well #3184

@KrauseFx
Copy link
Member

KrauseFx commented Jan 4, 2017

Sorry, I don't know how to fix that - it's probably related to either your project or your machine. If you have any idea on how fastlane should behave differently to fix that issue, please let me know. For now, you should be fine using the legacy build API, however be aware that it's been deprecated by Apple.

@tommeier
Copy link
Contributor

I'm also experiencing this too, our scenario is for a project that is distributed and resigned by the client, we package up release builds with Hockey for ipas but not for the 'production' target which is for the app store. For the production target we generate an xcarchive, where we don't have distribution rights, they then resign this. Gym has always been able to generate this xcarchive.

With use_legacy_build_api the gym command succeeds (just with the warning of deprecation) and we successfully generate an archive_path for them. However removing it, fails with the signing error.

error shown:

error: exportArchive: No valid iOS Distribution signing identities belonging to team xxxxxx were found.

more detail:

gym command:

gym(
    scheme: 'xxxx',
    clean: true,
    #use_legacy_build_api: true,
    configuration: ENV['DEBUG'] ? 'Debug' : 'Release',
    archive_path: 'xxxxx.xcarchive'
  )

with use_legacy_api:

[13:46:07]: ▸ Archive Succeeded
[13:46:08]: Successfully stored the archive. You can find it in the Xcode Organizer.
[13:46:08]: $ /usr/bin/xcrun /tmp/PackageApplication4Gym -v xxxxxxx.xcarchive/Products/Applications/xxxx.app -o '/var/folders/mp/nnzg__3d4p58h9qqffb3098m0000gp/T/gym_output20170118-38164-cfdx6g/xxxx.ipa' exportFormat ipa
[13:46:19]: $ zip --recurse-paths '/var/folders/mp/nnzg__3d4p58h9qqffb3098m0000gp/T/gym_output20170118-38164-cfdx6g/xxxx.ipa' SwiftSupport > /dev/null
[13:46:23]: Compressing 15 dSYM(s)

identical gym command without use_legacy_api:

[13:48:40]: ▸ Archive Succeeded
[13:48:40]: Successfully stored the archive. You can find it in the Xcode Organizer.
[13:48:40]: Generated plist file with the following values:
[13:48:40]: ▸ -----------------------------------------
[13:48:40]: ▸ {
[13:48:40]: ▸   "method": "app-store",
[13:48:40]: ▸   "uploadSymbols": true,
[13:48:40]: ▸   "uploadBitcode": false
[13:48:40]: ▸ }
[13:48:40]: ▸ -----------------------------------------
[13:48:40]: $ /usr/bin/xcrun /opt/boxen/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/fastlane-2.8.0/gym/lib/assets/wrap_xcodebuild/xcbuild-safe.sh -exportArchive -exportOptionsPlist '/var/folders/mp/nnzg__3d4p58h9qqffb3098m0000gp/T/gym_config20170118-41112-prtoco.plist' -archivePath xxxxxx.xcarchive -exportPath '/var/folders/mp/nnzg__3d4p58h9qqffb3098m0000gp/T/gym_output20170118-41112-u0jyil'
rbenv detected, removing env variables
+ xcodebuild -exportArchive -exportOptionsPlist /var/folders/mp/nnzg__3d4p58h9qqffb3098m0000gp/T/gym_config20170118-41112-prtoco.plist -archivePath xxxxxx.xcarchive -exportPath /var/folders/mp/nnzg__3d4p58h9qqffb3098m0000gp/T/gym_output20170118-41112-u0jyil
2017-01-18 13:48:41.477 xcodebuild[44024:781878] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/mp/nnzg__3d4p58h9qqffb3098m0000gp/T/xxxx_2017-01-18_13-48-41.476.xcdistributionlogs'.
2017-01-18 13:48:41.857 xcodebuild[44024:781878] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7f805d632cb0>: Error Domain=IDEDistributionErrorDomain Code=1 "No valid iOS Distribution signing identities belonging to team xxxxxx were found." UserInfo={NSLocalizedDescription=No valid iOS Distribution signing identities belonging to team xxxxx were found.}
error: exportArchive: No valid iOS Distribution signing identities belonging to team xxxxx were found.

Error Domain=IDEDistributionErrorDomain Code=1 "No valid iOS Distribution signing identities belonging to team 4AWFASC2C5 were found." UserInfo={NSLocalizedDescription=No valid iOS Distribution signing identities belonging to team 4AWFASC2C5 were found.}

** EXPORT FAILED **

So it looks like archive_path behaviour may have changed? or will it be no longer possible to use gym to export archives for this scenario when it is fully deprecated?

@romk1n
Copy link

romk1n commented Jan 18, 2017

Fixed the issue by explicitly providing the btcode flag and specifying tookchain. Thanks.

@tomachi
Copy link

tomachi commented Feb 8, 2017

Tried @romk1n 's suggestion. Didn't solve the issue. I have the same issue when I set use_legacy_build_api to false with Xcode8. A whole day spent with no solution but make it set to true.

@mgrebenets
Copy link
Collaborator

mgrebenets commented Feb 9, 2017 via email

@rikoschmidt
Copy link

rikoschmidt commented Mar 1, 2017

Setting the export_method to enterprise worked for us.

Please notice: export_mode did not work, however export_method did:

gym(scheme: "Foo Bar Inhouse", export_method: "enterprise")

Thanks @mgrebenets for this hint.

@tomachi
Copy link

tomachi commented Mar 1, 2017

I already have this enabled, but with development and not enterprise. You think this is the case?

@mgrebenets
Copy link
Collaborator

mgrebenets commented Mar 2, 2017 via email

@peepo3663
Copy link

peepo3663 commented Apr 5, 2017

I am facing this issue too, even I have changed "export_method" to "enterprise", It still not work for me.

Previous, in Xcode 8.2.1, I used --use_legacy_build_api with true is fine

@daswass
Copy link

daswass commented Apr 10, 2017

I changed export method from ad-hoc to development, and that solved this issue for me.

@truth3
Copy link

truth3 commented May 17, 2017

I just ran into this challenge today for a group that only provides a dev cert and provision profile.

They prefer to sign for distribution on their own and not hand that out to anyone. As @redi-wassere mentioned, setting the gym parameter to the following resolved the issue.

GYM_EXPORT_METHOD = 'development'

Seems like we could close this now, @vegidio-symbio what do you think?

@ghost ghost closed this as completed May 22, 2017
@fastlane fastlane locked and limited conversation to collaborators Aug 20, 2017
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants