Export Error : Jenkins with Xcode - ios

I am trying to export IPA from Jenkins. I have installed Jenkins in Unix. To build xcode project on this server, I have created a Slave node to build project.
Archive created successfully.
`export
PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/usr/bin/touch -c /Users/tushar/Library/Developer/Xcode/DerivedData/*-ddkzgiiehnftznefgacmhnffkdiv/Build/Intermediates.noindex/ArchiveIntermediates/OET/BuildProductsPath/Release-iphoneos/***.app.dSYM
** ARCHIVE SUCCEEDED **
Finished: SUCCESS `
I am getting following error ---
2018-02-26 16:32:31.244 xcodebuild[15086:3083978] [MT]
IDEDistribution: Step failed: : Error
Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating
signing assets failed." UserInfo={NSLocalizedDescription=Locating
signing assets failed.,
IDEDistributionSigningAssetStepUnderlyingErrors=(
"Error Domain=IDEProvisioningErrorDomain Code=9 \"\"***.app\" requires a provisioning profile.\"
UserInfo={NSLocalizedDescription=\"****.app\" requires a provisioning
profile., NSLocalizedRecoverySuggestion=Add a profile to the
\"provisioningProfiles\" dictionary in your Export Options property
list.}" )} error: exportArchive: "****.app" requires a provisioning
profile.
Can some one please help me?

You need to download the Provisioning File on your node machine and drag and drop it to Xcode installed on the node.
Furthermore, if you are using exportPlist file to sign the build then you have to mention the Provisioning Profile name in exportPlist file as well.

Related

xcodebuild ios export archive fail on success build

I am trying to build a complicated xcworkspace that contains 8 xcodeproj.
Main project (target app, framework, app extension)
Pods
6 cpp projects with one static library target each (these have dependencies with each other and added to the final project)
I can build the project via xcodebuild command. I am also able to Archive it, but I cannot export the IPA file, it always gets the following error:
2020-03-18 19:04:49.801 xcodebuild[28749:691158] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/vr/1fb5zcxd0gg92359ynn0r2gm0000gn/T/xxxxx_2020-03-18_19-04-49.800.xcdistributionlogs'.
2020-03-18 19:04:49.834 xcodebuild[28749:691158] [MT] IDEDistributionMethodManager: -[IDEDistributionMethodManager orderedDistributionMethodsForTask:archive:]: Error = Error Domain=IDEDistributionMethodManagerErrorDomain Code=2 "Unknown Distribution Error" UserInfo={NSLocalizedDescription=Unknown Distribution Error}
error: exportArchive: exportOptionsPlist error for key 'method': expected one of {}, but no value was provided
Error Domain=IDEFoundationErrorDomain Code=1 "exportOptionsPlist error for key 'method': expected one of {}, but no value was provided" UserInfo={NSLocalizedDescription=exportOptionsPlist error for key 'method': expected one of {}, but no value was provided}
I also tried to use the XCode 10.3 (10G8) UI in order to perform the same actions. This results to the Organizer screen where I see the xcarchive erroneous located in a group "Other Items" and not "iOS Apps" as it should.
Additionally, the option
"Validate Content" is disabled.
"Distribute Content" does not provide anything for iOS packing.
I have verified that my build commands are correct as the project was able to build with these in its previous state.
I've tried changing static project libraries dependencies but when adding all dependencies to all items it ends with a build error of multiple symbols.
I suspect that something in the build settings, or library/header references is faulty, but I cannot really troubleshoot it.
Is there any way to get additional information for the problem?
I had the same issue. I had to reset my developer certificate on our build server to resolve this.
I hope this helps others.

Phonegap Build Error: Xcode could not determine type of profile / No signing certificate "iOS Distribution" found - Xcode 11 or Xcode 10.1

I'm trying to compile an IPA for distribution in Phonegap Build, but I'm receiving the following error:
Running command: xcodebuild -exportArchive -archivePath Releva.xcarchive -exportOptionsPlist /private/project/exportOptions.plist -exportPath /private/project/build/device
2020-02-19 14:42:12.285 xcodebuild[46455:98411165] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/37/x2444x712rnbshh_b1tlfwsm0000gp/T/************.xcdistributionlogs'.
2020-02-19 14:42:12.665 xcodebuild[46455:98411167] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks_Fall2018/IDEFrameworks-14460.46/IDEFoundation/Provisioning/IDEProfileQualification.m:509
Details: Xcode could not determine type of profile "/Library/MobileDevice/Provisioning Profiles/production-ios-1582151957--90970.mobileprovision" (could be {(
)})
Object: <IDEProfileQualification: 0x7fd1f6e0b350>
Method: -_profileTypeQualifier
Thread: <NSThread: 0x7fd1f6806dc0>{number = 4, name = (null)}
Please file a bug at https://bugreport.apple.com with this warning message and any useful information you can provide.
error: exportArchive: No signing certificate "iOS Distribution" found
Error Domain=IDECodesignResolverErrorDomain Code=1 "No signing certificate "iOS Distribution" found" UserInfo={IDEProvisioningError_UserInfoKey_IDEProvisioningErrorPlatform=com.apple.platform.iphoneos, IDEProvisioningError_UserInfoKey_IDEProvisioningErrorAction=5, NSLocalizedRecoverySuggestion=No "iOS Distribution" signing certificate matching team ID "************" with a private key was found., IDEProvisioningError_UserInfoKey_IDEProvisioningErrorSpecifier=iOS Distribution, IDEProvisioningError_UserInfoKey_IDEProvisioningErrorTeam=<IDEProvisioningBasicTeam: 0x7fd1f6e0a330; teamID='***********', teamName='(null)'>, NSLocalizedDescription=No signing certificate "iOS Distribution" found}
I tried and retried everything with the credentials and provisioning profiles, but continue to get the same error. Creating them again and again, selecting the certificate with the private key together to export the p12, etc ..
Only thing I noticed is that when I select the certifcate to create the Provisioning Profile, it says "For use in Xcode 11 or later":
And in the error log it says "Xcode could not determine type of profile" and appears "Applications/Xcode101.app" in a lot of lines what makes me think it's trying to compile it with Xcode 10.1
What can I do for Pronegap Build to use Xcode 11 when I submit it?
Is anyone else having this issue? Any workaround to this?
Well, the problem was at the moment of creating the certificate in developers.apple.com. (Not the Provisiotioning Profile)
It seems Apple changed that last year, and now you have 2 options. One is Apple Distribution for Xcode 11+ and iOS (App Store and Ad Hoc) for any version.
Hope it helps anyone else having this issue.

Why do I get an error signing ionic-cordova ios app from the command line if it works perfectly in the gui version of xcode?

I'm trying to build an Ionic - Cordova iOs app from the command line (to use an azure devops build and deployment agent), but from the last updates (certificates, xcode, OS, etc), i have no success anymore.
After trying a lot of options, i'm some lost with xcode command line. A 'few updates' before, this command where working perfectly, so I don't know what are happening with the profiles and certificates.
This is the command lines that I'm using:
security unlock-keychain -p **** [keychainpath]
ionic build --prod
ionic cordova build ios --no-build --release --device --provisioningProfile="*****" -- --buildFlag="-UseModernBuildSystem=0" --developmentTeam=***** --codeSignIdentity="iPhone Developer" --packageType=app-store
And this this is the result (I omitting all the log before the "archive succeded"):
** ARCHIVE SUCCEEDED **
2019-11-15 08:01:36.413 xcodebuild[32327:470732] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/jg/06xlqgms5n54qgh0mcj3tkvw0000gp/T/******_2019-11-15_08-01-36.412.xcdistributionlogs'.
error: exportArchive: No profiles for '*********' were found
Error Domain=IDEProfileLocatorErrorDomain Code=1 "No profiles for '*****' were found" UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription=No profiles for '******' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS App Store provisioning profiles matching '******'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}
** EXPORT FAILED **
(node:31915) UnhandledPromiseRejectionWarning: Error code 70 for command: xcodebuild with args: -exportArchive,-archivePath,*******.xcarchive,-exportOptionsPlist,/Users/*****/*****/_work/1/s/platforms/ios/exportOptions.plist,-exportPath,/Users/*****/*****/_work/1/s/platforms/ios/build/device
(node:31915) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:31915) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I have tryied to build the app with the GUI of XCode (and the same user) without problems, so I guess that certificates and provisioning profiles there must be allright.
Any clue on what are happening with the command line?
I finally found the answer: It was a bad combination of distribution profile and development profile parameters.
I found it using the --verbose mode in cordova build
I changed the way to define the parameters to build the ios package using a "build.json" definition file:
build.json
{
"ios": {
"debug": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "*******",
"packageType: development,
"provisioningProfile": "*******"
},
"release": {
"codeSignIdentity": "iPhone Distribution",
"developmentTeam": "******",
"packageType": "app-store",
"provisioningProfile": "*******"
}
}
}
Which can used with the command line as follows:
ionic cordova build ios --no-build --prod --release --device --buildConfig build.json
Thanks to this I was able to see where the problem was and finally a was able to get the ipa file well signed.

No 'teamID' specified and no team ID found in the archive in ionic

Working in Ionic 2, then upgrading to 3 to try to fix this error. It began when I was trying to figure out a cordova plugin. The archive doesnt appear to be signed correctly.
** ARCHIVE SUCCEEDED **
2017-10-03 14:40:10.745 xcodebuild[4293:73077] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/12/9djblkvn1_7g0_41crqy9ht00000gn/T/Omnidispatch_2017-10-03_14-40-10.744.xcdistributionlogs'.
2017-10-03 14:40:10.965 xcodebuild[4293:73077] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7fa1dde9d300>: Error Domain=IDEFoundationErrorDomain Code=1 "No 'teamID' specified and no team ID found in the archive" UserInfo={NSLocalizedDescription=No 'teamID' specified and no team ID found in the archive}
error: exportArchive: No 'teamID' specified and no team ID found in the archive
Error Domain=IDEFoundationErrorDomain Code=1 "No 'teamID' specified and no team ID found in the archive" UserInfo={NSLocalizedDescription=No 'teamID' specified and no team ID found in the archive}
** EXPORT FAILED **
Error: Error code 70 for command: xcodebuild with args: -exportArchive,-archivePath,Omnidispatch.xcarchive,-exportOptionsPlist,/Developer/omnisolutions/omni-ionic/platforms/ios/exportOptions.plist,-exportPath,/Developer/omnisolutions/omni-ionic/platforms/ios/build/device
There have been a few solutions that suggest that its not the team id, but rather a certificate error. I'm not very good with mac certificates, but they seem to be in place and I've not changed them since this broke.
I have gone into xcode a time or two and the team was not saved, I've fixed that every time I've seen it and it seems to be staying there now, but its still not changing anything when i run ionic build ios
What else can I check?
I should add, that it builds in xcode 8, but not in vscode or on the commandline as it did previously.
I faced the same issue during a ionic cordova build without signature (for
pro MDM):
ionic build ios --release --device
--buildFlag="-UseModernBuildSystem=0"
finally I smash it using a build.json at the root folder with only the developmentTeam Info filled
{
"ios": {
"debug": {
"codeSignIdentity": "Apple Development: BLa BLa (XXXXXXX)",
"provisioningProfile": "<XXXXXX-XXXXXX-XXXXX>",
"provisioningProfileFile": "embedded.mobileprovision",
"certificateFile": "blabla.p12",
"developmentTeam": "<TEAMID>"
},
"release": {
"codeSignIdentity": "",
"provisioningProfile": "",
"provisioningProfileFile": "",
"certificateFile": "",
"developmentTeam": "<TEAMID>"
}
}
}
Hope it's help you
Unfortunately I did not find a great solution for this error. I was forced to rm -rf my directory, uninstall ionic and cordova and bring it all down from git and set it up again.

Xcode 8.2.1 Failed to codesign archive

I am trying to upload an archive for test flight to itunesconnect. However, when I go to validate the archive I get an error message saying that code signing failed and that a .ipa file is missing. I have scoured the internet for quite some time and can't find a viable solution to fixing this problem.
Xcode: Version 8.2.1 (8C1002)
Deployment Target: iOS 8.0+
IDEDistribution.standard.log:
2017-03-15 20:25:03 +0000 [MT] Validation failed for archive ******* with issues: IDEDistributionIssue: severity(error), error(Error Domain=ITunesSoftwareServiceErrorDomain Code=-21013 \"The archive is invalid. /var/folders/yc/y1chf6z95zj63mnsw7m6qwm80000gn/T/XcodeDistPipeline.6rX/Packages/*******.ipa does not exist.\" UserInfo={NSLocalizedDescription=The archive is invalid. /var/folders/yc/y1chf6z95zj63mnsw7m6qwm80000gn/T/XcodeDistPipeline.6rX/Packages/*******.ipa does not exist., NSLocalizedFailureReason=Unable to validate your application.})
IDEDistribution.critical.log
2017-03-15 20:19:52 +0000 [MT] Presenting: Error Domain=IDEFoundationErrorDomain Code=1 "Codesign failed" UserInfo={NSLocalizedDescription=Codesign failed}
I got it working. We are using Carthage libraries in the project, and I guess the code signing of the libraries we were using didn't like our project for some reason. I manually placed the source code for the libraries into the project and it ran fine.

Resources