简体   繁体   English

通过 Azure Devops Extension 上传到 AppStore 时如何修复“Invalid Provisioning Profile”?

[英]How to fix the “Invalid Provisioning Profile” when uploading to AppStore through Azure Devops Extension?

I'm implementing continuous integration using Azure Devops and fastlane for an iOS app.我正在使用 Azure Devops 和 fastlane 为 iOS 应用程序实施持续集成。 It build and create the IPA file, however, when I try to upload the file after successfully creating the package I get this error message: "Invalid Provisioning Profile".它构建并创建 IPA 文件,但是,当我在成功创建 package 后尝试上传文件时,我收到此错误消息:“无效的配置文件”。 This is the only distribution profile used in the app and it's working fine with Xcode, so it's valid.这是应用程序中使用的唯一分发配置文件,它可以与 Xcode 一起正常工作,因此它是有效的。 How to fix it?如何解决?

  • Change the code signing identity to automatic and manual, in both project and target.在项目和目标中将代码签名身份更改为自动和手动。 -Using manual sign in. It's currently in automatic mode. - 使用手动登录。它目前处于自动模式。
  • Provisioning profile on build settings inside Xcode, currently in automatic, was changed to Manual and set as 5c0e9419-2a5a-4905-ac99-e680efac07a5. Xcode 内部构建设置的配置配置文件(当前处于自动状态)已更改为手动并设置为 5c0e9419-2a5a-4905-ac99-e680efac07a5。 I changed back to automatic.我改回自动了。
  • Used only the distribution certificate on the Xcode build.仅使用 Xcode 版本上的分发证书。 When I try that, there's an error in the build saying it can't find an iOS Development provisioning profile.当我尝试这样做时,构建中出现错误,说它找不到 iOS 开发配置文件。 I'm currently installing both development and distribution certificates on the pipeline build.我目前正在管道构建上安装开发和分发证书。

Here's is how I setup Azure Devops (Build Pipeline).这是我设置 Azure Devops(构建管道)的方法。

- master

pool:
  vmImage: 'macos-latest'

steps:
- task: InstallAppleCertificate@2
  inputs:
    certSecureFile: 'iOSDistributionCertificate.p12'
    certPwd: 'xxxxx'
    keychain: 'temp'

- task: InstallAppleCertificate@2
  inputs:
    certSecureFile: 'iOSDevelopmentCertificate.p12'
    certPwd: 'xxxxx'
    keychain: 'temp'

- task: InstallAppleProvisioningProfile@1
  inputs:
    provisioningProfileLocation: 'secureFiles'
    provProfileSecureFile: '5c0e9419-2a5a-4905-ac99-e680efac07a5.mobileprovision'

- task: InstallAppleProvisioningProfile@1
  inputs:
    provisioningProfileLocation: 'secureFiles'
    provProfileSecureFile: '4e932719-f9bd-4d3e-b4e6-08b35260c632.mobileprovision'

- task: ios-bundle-version@1
  inputs:
    sourcePath: 'BookingApp/info.plist'
    versionCodeOption: 'buildid'
    versionCode: '$(Build.BuildId)'
    versionCodeOffset: '0'
    printFile: true

- task: Xcode@5
  displayName: 'Build the app using Xcode'
  inputs:
    actions: 'build'
    sdk: 'iphoneos12.4'
    configuration: 'Release'
    scheme: 'BookingApp'
    packageApp: true
    xcodeVersion: 10 # Options: 8, 9, 10, default, specifyPath
    signingOption: 'auto'
    useXcpretty: false # Makes it easier to diagnose build failures
    xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace'

- task: AppStoreRelease@1
  inputs:
    serviceEndpoint: 'Booking App Connection'
    appType: 'iOS'
    ipaPath: '**/*.ipa'
    releaseTrack: 'TestFlight'
    installFastlane: false

And here's the error message.这是错误消息。

[17:02:55]: ‌Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile‌
[17:02:56]: Sending anonymous analytics information
[17:02:56]: Learn more at https://docs.fastlane.tools/#metrics
[17:02:56]: No personal or sensitive data is sent.
[17:02:56]: You can disable this by adding `opt_out_usage` at the top of your Fastfile
[17:02:56]: Login to App Store Connect (***)
[17:03:13]: Login successful
/usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/document.rb:44: warning: constant ::Fixnum is deprecated
[17:03:16]: Ready to upload new build to TestFlight (App: 1483789798)...
[17:03:16]: Fetching password for transporter from environment variable named `FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD`
[17:03:16]: Going to upload updated app to App Store Connect
[17:03:16]: This might take a few minutes. Please don't interrupt the script.
[17:04:09]: [Transporter Error Output]: ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
[17:04:09]: Transporter transfer failed.
[17:04:09]: 
[17:04:09]: ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main> DBG-X:   parameter ErrorCode = 1102

[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main> DBG-X:   parameter ErrorMessage = ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal.

[17:04:09]: [iTMSTransporter]  (1102)

[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main> ERROR: ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."

[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main> DBG-X: The error code is: 1102

[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main>  INFO: Done performing authentication. 

[17:04:09]: [iTMSTransporter] 1 package(s) were not uploaded because they had problems:

[17:04:09]: [iTMSTransporter]   /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20191016-2378-s6wyrx/1483789798.itmsp - Error Messages:

[17:04:09]: [iTMSTransporter]       ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."

[17:04:09]: [iTMSTransporter] [2019-10-16 17:04:09 UTC] <main> DBG-X: Returning 1

[17:04:09]: iTunes Transporter output above ^
[17:04:09]: ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."
Return status of iTunes Transporter was 1: ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning profile included in the bundle BAG.BookingAppTests [Payload/BookingApp.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal."

Thanks in advance提前致谢

It happened to me several times until I decide to create again the profiles and make some changes in my yml file.它发生在我身上好几次,直到我决定再次创建配置文件并在我的 yml 文件中进行一些更改。 Here is a full working pipeline:这是一个完整的工作管道:

# Xcode
# Build, test, and archive an Xcode workspace on macOS.
# Add steps that install certificates, test, sign, and distribute an app, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/xcode
# Production
# Note: The certificates annd provisioning profiles path/passwors are stored in Group Variables

trigger:
 - master   

pool:
  vmImage: 'macOS-10.14'

variables:
  - group: 'Distribution Demo iOS'
  - name: BuildConfiguration
    value: 'Dev Release'
  - name: XCWorkSpacePath 
    value: 'CLI.xcworkspace'
  - name: Scheme 
    value: 'CLI'
  - name: ExportPath
    value: 'build'
  - name: ExportOptionsPListPath 
    value: 'exportOptions.plist'
  - name: AppIdentifier 
    value: 'cli.dev.test.CLI'
  - name: sdk 
    value: 'iphoneos'

steps:

- task: CocoaPods@0
  displayName: 'Downloading dependencies using CocoaPods with a forced repo update'
  inputs:
    forceRepoUpdate: true 

- task: InstallAppleCertificate@2
  displayName: 'Installing Apple Certificates from Secure Files'
  inputs:
    certSecureFile: $(CertificateFileName)
    certPwd: $(CertificatePassword)

- task: InstallAppleProvisioningProfile@1
  displayName: 'Installing Apple Provisioning Profile from Secure Files'
  inputs:
    provisioningProfileLocation: secureFiles
    provProfileSecureFile: $(ProvisioningFileName)
    removeProfile: false 

# Uncomment the next lines if you want to the current build manages the next version
#- task: Bash@3
#  displayName: 'Updating Build Number to the Next Version'
#  inputs:
#    targetType: inline
#    script: 'xcrun agvtool next-version -all'

- task: Xcode@5
  displayName: 'Archiving Application and Save In Build Path' 
  inputs:
    actions: 'archive'
    configuration: $(BuildConfiguration)
    xcWorkspacePath: $(XCWorkSpacePath)
    scheme: $(Scheme)
    packageApp: true 
    archivePath: $(ExportPath)
    exportPath: $(ExportPath)
    exportOptions: plist
    exportOptionsPlist: $(ExportOptionsPListPath)
    signingOption: manual
    provisioningProfileUuid: $(ProvisioningProfileUUID)
    provisioningProfileName: $(ProvisioningProfileName)

- task: CopyFiles@2
  displayName: 'Copying IPA to Artifacts Directory'
  inputs:
    Contents: '$(ExportPath)/*.ipa'
    TargetFolder: '$(Build.artifactStagingDirectory)'

- task: PublishBuildArtifacts@1
  displayName: 'Uploading IPA for the Currenet Run'
  inputs:
    PathtoPublish: '$(Build.artifactStagingDirectory)'
    ArtifactName: 'GeneratedIPA'
    PublishLocation: Container

- task: AppStoreRelease@1
  displayName: 'Releasing IPA to TestFlight'
  inputs:
    serviceEndpoint: 'Apple2'
    appIdentifier: $(AppIdentifier)
    appType: iOS
    ipaPath: '$(Build.artifactStagingDirectory)/**/*.ipa'
    releaseTrack: TestFlight
    releaseNotes: 'testflight.developer_notes.txt'
    shouldSkipWaitingForProcessing: false 
    shouldSkipSubmission: false 
    # If you want to distribute to external testers uncomment the next two variables and write the group in externalTestersGroups
    # distributedToExternalTesters: true 
    # externalTestersGroups: 'groups'
    teamId: $(TeamID)
    teamName: $(TeamName)
    fastlaneArguments: 'action increment_build_number'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 提交WatchKit扩展时,配置文件无效? - Invalid provisioning profile when submitting WatchKit extension? 在应用商店上传应用程序时,xcode 9.2 中的“无需配置文件” - “No provisioning profile required” in xcode 9.2, while uploading app on appstore 将 ipa 上传到 AppStore 时如何修复“'CFBundleIconName' is missing”错误? - How to fix “'CFBundleIconName' is missing” error when uploading ipa to AppStore? 发布到AppStore时配置文件显示错误的应用程序名称 - provisioning profile shows wrong application name when publishing to AppStore React Native iOS - 如何将配置文件添加到提交到 Appstore 的 ipa - React Native iOS - How to add Provisioning Profile to ipa submitted to Appstore Azure Devops macOS 管道在托管时因缺少配置文件而失败 - Azure Devops macOS Pipeline fails on hosted with missing provisioning profile Azure Devops Pipelines for ionic iOS - 配置文件错误。 Select 签名和功能编辑器中的配置文件 - Azure Devops Pipelines for ionic iOS - Error of provisioning profile. Select a provisioning profile in the Signing & Capabilities editor 使用Appstore设置和AdHoc设置配置文件提交二进制文件以供Appstore审核 - Submitting binary for Appstore review with Appstore provisioning and AdHoc Provisioning profile 如何在将应用程序上传到ios中的appstore时解决此问题 - How to fix this issues on uploading app to appstore in ios 测试飞行错误:无效的IPA:缺少嵌入式配置文件-如何解决此问题? - Test Flight Error: Invalid IPA: missing embedded provisioning profile - How do I fix this?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM