microsoft / vsts-cordova-tasks

Streamline CI setup for your Apache Cordova, PhoneGap, Ionic, or Cordova CLI compatible app using a set of useful pre-defined build steps for VS Team Services or TFS
http://go.microsoft.com/fwlink/?LinkID=691188
Other
25 stars 27 forks source link

Create ipa using Distribution Provisioning Profile #92

Open aakshir opened 5 years ago

aakshir commented 5 years ago

Hello,

I'm trying to invoke the "Cordova" Build task to create an ipa file that I will use to publish to Test Flight. When I use the "Development" Provisioning profile, the ipa is created but I cannot push it to Test Flight. However when I use the "Distribution" Provisioning profile, the task fails with the below error:

Validate /Users/vsts/Library/Developer/Xcode/DerivedData/OpenFITTest-fyobrvavtatoslefvcmhhwoxjatq/Build/Intermediates.noindex/ArchiveIntermediates/OpenFITTest/InstallationBuildProductsLocation/Applications/OpenFITTest.app cd /Users/vsts/agent/2.147.1/work/1/s/OpenFitApp/platforms/ios export PATH="/Applications/Xcode_9.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode_9.4.1.app/Contents/Developer/usr/bin:/usr/local/lib/ruby/gems/2.6.0/bin:/usr/local/opt/ruby/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/vsts/bin:/Users/vsts/.yarn/bin:/usr/local/go/bin:/Users/vsts/Library/Android/sdk/tools:/Users/vsts/Library/Android/sdk/platform-tools:/Users/vsts/Library/Android/sdk/ndk-bundle:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/vsts/.azcopy" export PRODUCT_TYPE=com.apple.product-type.application builtin-validationUtility /Users/vsts/Library/Developer/Xcode/DerivedData/OpenFITTest-fyobrvavtatoslefvcmhhwoxjatq/Build/Intermediates.noindex/ArchiveIntermediates/OpenFITTest/InstallationBuildProductsLocation/Applications/OpenFITTest.app

Touch build/device/OpenFITTest.app.dSYM cd /Users/vsts/agent/2.147.1/work/1/s/OpenFitApp/platforms/ios export PATH="/Applications/Xcode_9.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode_9.4.1.app/Contents/Developer/usr/bin:/usr/local/lib/ruby/gems/2.6.0/bin:/usr/local/opt/ruby/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/vsts/bin:/Users/vsts/.yarn/bin:/usr/local/go/bin:/Users/vsts/Library/Android/sdk/tools:/Users/vsts/Library/Android/sdk/platform-tools:/Users/vsts/Library/Android/sdk/ndk-bundle:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/vsts/.azcopy" /usr/bin/touch -c /Users/vsts/agent/2.147.1/work/1/s/OpenFitApp/platforms/ios/build/device/OpenFITTest.app.dSYM

ARCHIVE SUCCEEDED

2019-03-15 19:18:24.022 xcodebuild[1062:8924] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/OpenFITTest_2019-03-15_19-18-24.021.xcdistributionlogs'. 2019-03-15 19:18:24.179 xcodebuild[1062:8924] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7f8a28903870>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=( "Error Domain=IDECodesignResolverErrorDomain Code=1 \"No signing certificate \"iOS Development\" found\" UserInfo={IDEProvisioningError_UserInfoKey_IDEProvisioningErrorPlatform=com.apple.platform.iphoneos, IDEProvisioningError_UserInfoKey_IDEProvisioningErrorAction=5, NSLocalizedRecoverySuggestion=No \"iOS Development\" signing certificate matching team ID \"XXXXXX\" with a private key was found., IDEProvisioningError_UserInfoKey_IDEProvisioningErrorSpecifier=iOS Development, IDEProvisioningError_UserInfoKey_IDEProvisioningErrorTeam=<IDEProvisioningBasicTeam: 0x7f8a28907ea0; teamID='XXXXXXX', teamName='(null)'>, NSLocalizedDescription=No signing certificate \"iOS Development\" found}", "Error Domain=IDEProfileQualificationErrorDomain Code=3 \"Provisioning profile \"PROD OpenFIT\" is not an \"iOS App Development\" profile.\" UserInfo={IDEProfileQualificationError_Profile=<IDEEmbeddedProvisioningProfile 0x7f8a28600c20: name: PROD OpenFIT, UUID: 1aba9f6c-7cdd-4a28-b91c-a092f5ede4db, teamName: GroupNos Technologies Ltd., teamIdentifierPrefixes: (\n XXXXX\n), entitlements: {\n \"application-identifier\" = \"XXXXXX.com.groupnos.com.groupnos.openfitapp\";\n \"beta-reports-active\" = 1;\n \"com.apple.developer.team-identifier\" = XXXXXX;\n \"get-task-allow\" = 0;\n \"keychain-access-groups\" = (\n \"XXXXXX.*\"\n );\n}, appIdentifierName: com-groupnos-com-groupnos-openfitapp, applicationIdentifierPrefixes: (\n XXXXXX\n), dateCreated: 2019-03-15 12:48:21 +0000, dateExpired: 2020-03-14 12:34:05 +0000, certificateKind: 1.2.840.113635.100.6.1.4, certificateSHA1Hashes: {(\n 853365547DAED652183488D0E4B17196C80BB687\n)}, supportedUDIDs: {(\n)}, isUniversal: 0, isXcodeManaged: 0, platforms: {(\n <DVTPlatform:0x7f8a25f3c5c0:'com.apple.platform.watchos':<DVTFilePath:0x7f8a25f3c540:'/Applications/Xcode_9.4.1.app/Contents/Developer/Platforms/WatchOS.platform'>>,\n <DVTPlatform:0x7f8a25f317b0:'com.apple.platform.iphoneos':<DVTFilePath:0x7f8a25f31250:'/Applications/Xcode_9.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform'>>\n)}, filePath: <DVTFilePath:0x7f8a2873a8e0:'/Users/vsts/Library/MobileDevice/Provisioning Profiles/1aba9f6c-7cdd-4a28-b91c-a092f5ede4db.mobileprovision'>>, NSLocalizedDescription=Provisioning profile \"PROD OpenFIT\" is not an \"iOS App Development\" profile.}" )} error: exportArchive: No signing certificate "iOS Development" found

Error Domain=IDECodesignResolverErrorDomain Code=1 "No signing certificate "iOS Development" found" UserInfo={IDEProvisioningError_UserInfoKey_IDEProvisioningErrorPlatform=com.apple.platform.iphoneos, IDEProvisioningError_UserInfoKey_IDEProvisioningErrorAction=5, NSLocalizedRecoverySuggestion=No "iOS Development" signing certificate matching team ID "XXXXXX" with a private key was found., IDEProvisioningError_UserInfoKey_IDEProvisioningErrorSpecifier=iOS Development, IDEProvisioningError_UserInfoKey_IDEProvisioningErrorTeam=<IDEProvisioningBasicTeam: 0x7f8a28907ea0; teamID='XXXXXX', teamName='(null)'>, NSLocalizedDescription=No signing certificate "iOS Development" found}

error: exportArchive: Provisioning profile "PROD OpenFIT" is not an "iOS App Development" profile.

Any help is appreciated

Thanks

olemarius commented 5 years ago

I have the same issue. I've attached my pipeline code below.


- master

pool:
  vmImage: 'macOS-10.14'

variables:
  scheme: 'MyProject'
  sdk: 'iphoneos'
  configuration: 'release'

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '10.x' 
    checkLatest: false

- task: Npm@1
  displayName: 'npm install'
  inputs:
    command: 'install'

- task: IonicCommand@1
  displayName: 'Run Ionic Cordova Prepare'
  inputs:
    ionicCommand: 'cordova prepare'
    ionicVersion: '4.2.0'
    cordovaVersion: '9.0.0'

- task: IonicCommand@1
  displayName: 'Run Ionic build'
  inputs:
    ionicCommand: 'build'
    ionicVersion: '4.2.0'
    cordovaVersion: '9.0.0'

- task: InstallAppleCertificate@2 
  inputs:
    certSecureFile: 'myproject.p12'
    certPwd: $(P12Password)

- task: InstallAppleProvisioningProfile@1
  inputs:
    provProfileSecureFile: 'myproject_profile.mobileprovision'

- task: Xcode@5
  inputs:
    sdk: $(sdk)
    actions: 'clean build'
    configuration: $(configuration)
    xcWorkspacePath: '**/MyProject.xcworkspace'
    signingOption: 'manual' 
    signingIdentity: $(APPLE_CERTIFICATE_SIGNING_IDENTITY)
    provisioningProfileUuid: $(APPLE_PROV_PROFILE_UUID)
    packageApp: true
    scheme: '$(scheme)' 
    teamId: 'ABCDEFGH'
    useXcpretty: false 
    exportMethod: 'Automatic'
    exportTeamId: 'ABCDEFGH'
    exportPath: '$(Build.ArtifactStagingDirectory)'
    xcodeVersion: 'default'``` 
martin-richter-uk commented 4 years ago

I have the same issue.