Azure 管道无法使用 embedAndSignAppleFrameworkForXcode 和 fastlane 构建 Kotlin 多平台共享框架

Azure pipeline fails on building Kotlin Multiplatform shared framework usinig embedAndSignAppleFrameworkForXcode and fastlane

我正在开发一个 Kotlin Multiplatform 项目,该项目在本地构建良好,但我无法让它在 Azure DevOps 管道上运行。

一些好事要知道:

我正在尝试使用 fastlane 构建 Azure DevOps 管道并上传到 App Store Connect。我们使用 match 进行签名,效果很好。存档失败,看起来它在构建共享 KMM 框架时失败了。

谁有同样的问题可以帮助我吗?或者一些提示我如何查看 Azure VM 上的那些 gym 日志,因为我假设它说的是实际出了什么问题而不是这个一般错误。

▸ Running script 'Build Kotlin Common'
▸ Copying /Users/runner/Library/Developer/Xcode/DerivedData/Project-ffubndppzitzbxhibjgeavrhnzpw/Build/Intermediates.noindex/ArchiveIntermediates/Project/BuildProductsPath/ProjectRelease-iphoneos/Airship_AirshipCore.bundle
▸ Copying /Users/runner/Library/Developer/Xcode/DerivedData/Project-ffubndppzitzbxhibjgeavrhnzpw/Build/Intermediates.noindex/ArchiveIntermediates/Project/BuildProductsPath/Project Release-iphoneos/Airship_AirshipAutomation.bundle
** ARCHIVE FAILED **


The following build commands failed:
    PhaseScriptExecution Build\ Kotlin\ Common /Users/runner/Library/Developer/Xcode/DerivedData/Project-ffubndppzitzbxhibjgeavrhnzpw/Build/Intermediates.noindex/ArchiveIntermediates/Project/IntermediateBuildFilesPath/Project.build/ProjectRelease-iphoneos/Project.build/Script-2F4970EC27CD16A000E32F91.sh (in target 'Project' from project 'Project')
(1 failure)
ERROR [2022-05-10 13:04:32.36]: Exit status: 65

ERROR [2022-05-10 13:04:32.53]: ⬆️  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
WARN [2022-05-10 13:04:32.53]:   For the complete and more detailed error log, check the full log at:
WARN [2022-05-10 13:04:32.53]:   /Users/runner/Library/Logs/gym/Project-Project.log

这是 Fastfile 中的泳道:

    lane :azure_beta do |options|

        label = options[:label].capitalize

        git_url = "someURL"

        match(
            type: "appstore",
            readonly: true,
            git_url: git_url,
            keychain_name: ENV["MATCH_KEYCHAIN_NAME"],
            keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"],
            verbose: true
        )
        
        build_app(
            project: "../Project/Project.xcodeproj",
            configuration: "#{label}Release",
            scheme: label
        )
        # fails on the build_app step...
        
        changelog = changelog_from_git_commits(
            pretty: "- (%ae) %s",
            date_format: "short",
            merge_commit_filtering: "exclude_merges"
        )

        upload_to_testflight(
            changelog: changelog,
            app_identifier: label == "Project" ? idsProjectA : idsProjectB,
            skip_waiting_for_build_processing: true
        )

        version_number = get_version_number(
            xcodeproj: "../Project/Project.xcodeproj",
            target: "Project", #Hardcoded because we have multiple targets, label is specificed in build_app configuration
            configuration: "#{label}Release"
        )

        add_git_tag(
            includes_lane: false,
            prefix: "ios-#{label.downcase}-#{version_number}-",
            build_number: number_of_commits
        )

        delete_keychain(name: ENV["MATCH_KEYCHAIN_NAME"])
    end

这是我的管道 YAML:

pool:
  vmImage: 'macos-latest'

variables:
- group: fastlane

jobs: 
- job: testflight
  steps:
  - task: Bash@3
    displayName: fastlane update
    inputs:
      targetType: 'inline'
      script: |
        gem update fastlane
        fastlane --version
  - task: JavaToolInstaller@0
    inputs:
      versionSpec: '11'
      jdkArchitectureOption: 'x64'
      jdkSourceOption: 'PreInstalled'
  - task: Bash@3
    displayName: 'Update Dependencies'
    inputs:
      targetType: 'inline'
      script: HOMEBREW_NO_AUTO_UPDATE=1 brew bundle
  - task: Bash@3
    displayName: "Set build properties"
    inputs:
      targetType: 'inline'
      script: |
        echo "sdk.dir=/Users/runner/Library/Android/sdk"
        echo "INCLUDE_MOCKER=false" >> local.properties
        echo "INCLUDE_ANDROID=false" >> local.properties
        echo "INCLUDE_TESTER=false" >> local.properties
        echo "APP_LABEL=$(APP_LABEL)" >> local.properties
    env:
      APP_LABEL: $(APP_LABEL)
  - task: Gradle@2
    displayName: 'Clean label common'
    inputs:
      workingDirectory: ''
      tasks: "common:cleanLabel"
    env:
      APP_LABEL: $(APP_LABEL)
  - task: Bash@3
    displayName: fastlane ios
    env:
      MATCH_PASSWORD: $(MATCH_PASSWORD)
      FASTLANE_PASSWORD: $(FASTLANE_PASSWORD)
      FASTLANE_SESSION: $(FASTLANE_SESSION)
      FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: $(FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD)
    inputs:
      targetType: 'inline'
      script: |
        sudo xcode-select -s /Applications/Xcode_13.2.app
        cd ios/Project
        fastlane azure_beta label:Project app_identifier:project.bundle.id itc_team_id:itc.team.id team_id:team.id git_match_branch:master username:me@myself.com

事实证明,在构建公共 KMM 层时出现错误,我可能会在进行干净的结帐时发现它,但我发现是通过在 Azure Devops 上使用 self-hosted 代理,所以我可以按照 Pylyp Dukhov 的建议导航至 /Users/runner/Library/Logs/gym/Project-Project.log