Как исправить недопустимый профиль подготовки при загрузке в AppStore через расширение Azure Devops?

Я реализую непрерывную интеграцию с помощью Azure Devops и fastlane для приложения iOS. Он создает и создает файл IPA, однако, когда я пытаюсь загрузить файл после успешного создания пакета, я получаю следующее сообщение об ошибке: «Недопустимый профиль обеспечения». Это единственный профиль распространения, используемый в приложении, и он отлично работает с Xcode, так что он действителен. Как это исправить?

  • Измените идентификацию подписи кода на автоматическую и ручную как в проекте, так и в цели. -Использование ручного входа в систему. В настоящее время он находится в автоматическом режиме.
  • Профиль обеспечения в настройках сборки внутри Xcode, в настоящее время автоматический, был изменен на Вручную и установлен как 5c0e9419-2a5a-4905-ac99-e680efac07a5. Я снова переключился на автоматический.
  • Использовал только сертификат распространения в сборке Xcode. Когда я пытаюсь это сделать, в сборке появляется ошибка, в которой говорится, что не удается найти профиль подготовки для разработки iOS. В настоящее время я устанавливаю в сборку конвейера как сертификаты разработки, так и сертификаты распространения.

Вот как я настраиваю Azure Devops (Build Pipeline).

- 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

И вот сообщение об ошибке.

[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."

заранее спасибо


person msoto    schedule 17.10.2019    source источник


Ответы (1)


Это случалось со мной несколько раз, пока я не решил снова создать профили и внести некоторые изменения в свой файл yml. Вот полный рабочий конвейер:

# 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'
person Jorge    schedule 17.10.2019
comment
Спасибо за ваш ответ. Вот что я сделал до сих пор: 1. Удалил старые сертификаты в папке Provisioning. 2. Создал новый профиль обеспечения на веб-сайте Apple, загрузил и добавил в свой проект. 3- Изменил конфигурацию моего проекта xcode на Manual. 4- Подпись выбранного кода. Идентифицируйте цель следующим образом - Отладка: разработчик iOS. Релиз: Распространение iOS. Профиль обеспечения: выбирается вручную, однако при сборке появляется сообщение об ошибке: ошибка: требуется профиль обеспечения. Выберите профиль обеспечения для конфигурации сборки выпуска в редакторе проекта. - person msoto; 18.10.2019
comment
Какой профиль обеспечения и сертификаты вы использовали в своем коде, dev (разработка iOS) или производственную (iOS Distribution), и какой метод вы использовали для их экспорта? - person msoto; 18.10.2019
comment
Здравствуйте, я использовал iOS Distribution. Убедитесь, что вы нажимаете правильную ветку. - person Jorge; 18.10.2019
comment
Эй, мне удалось заставить это работать. Однако я создал профиль подготовки с помощью fastlane и загрузил в Azure только этот. После нескольких запусков fastlane начал требовать SMS-код, даже несмотря на то, что я добавил FASTLANE_SESSION, который я получил через fastlane spaceauth. Сообщение об ошибке: Вход в App Store Connect () Сеанс, загруженный из переменной среды, недействителен. Продолжаем с обычным входом в систему. Двухфакторная аутентификация (6-значный код) включена для учетной записи '' (введите sms, чтобы выйти из этого запроса, и выберите доверенный номер телефона ...). У вас была эта ошибка? - person msoto; 21.10.2019
comment
Да, вам нужно создать пароль приложения. Проверьте эту ссылку docs.fastlane.tools/best-practices/continuous-integration или, может быть, отключить двухфакторную аутентификацию, но я этого не рекомендую. - person Jorge; 21.10.2019
comment
Спасибо за ответ, но это то, что я сделал и работал впервые. Теперь он снова запрашивает код SMS, даже с паролем приложения, обычным паролем Apple и электронной почтой, а также кодом fastlane_session. Может это глюк от Apple или Fastlane. - person msoto; 22.10.2019