首页 > 解决方案 > React Native、AzureDevops 和 Fastlane ipa 构建失败

问题描述

我实际上是 AzureDevOps 的新手,这两天我似乎找不到在 AzureDevOps 上构建我的应用程序的解决方案。

这是我到目前为止所做的:

p12 证书已上传并按照本指南在管道中应用安装 Apple 证书

配置证书上传并在管道中应用安装 Apple 配置证书

现在,当我尝试使用 fastlane 构建我的 iOS 应用程序时:

  1. 光盘

  2. 捆绑安装

  3. 快车道测试版

    • setup_ci(力=真)

    • 健身房(方案:'app',工作区:'./ios/workspace',详细:true)

我正在寻找一种将 Azure DevOps 中的 p12 和配置文件证书用于我的健身房构建的方法。看了很多之后,我发现 setup_ci 会自动为我做这件事。

这是我的 Fastlane 文件

platform :ios do

    lane :beta do
        setup_ci(force=true)
        gym(
            scheme: 'AlfaCarpeting', workspace: './ios/AlfaCarpeting', verbose: true
        )
    end
end

这是我的 Azure 管道 yml 文件:

# Node.js with React
# Build a Node.js project that uses React.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

trigger:
  - master

pool:
  vmImage: 'macOS-10.15'

variables:
    - group: React Native Variables

steps:
  - task: InstallAppleCertificate@2
    inputs:
      certSecureFile: Certificates.p12
      certPwd: $(P12Password)
      keychain: 'temp'
      deleteCert: true
    displayName: Install Apple Certificate

  - task: InstallAppleProvisioningProfile@1
    inputs:
      provisioningProfileLocation: 'secureFiles'
      provProfileSecureFile: 'alfaCarpetingBeta.mobileprovision'
    displayName: 'Install Apple Provisioning Profile'

  - task: NodeTool@0
    inputs:
      versionSpec: '10.x'
    displayName: 'Install Node.js'

  - script: |
      cd ios
      bundle install
      fastlane ios beta
    displayName: 'Build iOS'

AzureDevops 的日志

[05:38:20]: $ set -o pipefail && xcodebuild -workspace ./AlfaCarpeting.xcworkspace -scheme AlfaCarpeting -destination 'generic/platform=iOS' -archivePath /Users/runner/Library/Developer/Xcode/Archives/2020-03-21/AlfaCarpeting\ 2020-03-21\ 05.38.20.xcarchive archive | tee /Users/runner/Library/Logs/gym/AlfaCarpeting-AlfaCarpeting.log | xcpretty
[05:38:22]: ▸ ❌  error: /Users/runner/runners/2.165.2/work/1/s/ios/Pods/Target Support Files/Pods-AlfaCarpeting/Pods-AlfaCarpeting.release.xcconfig: unable to open file (in target "AlfaCarpeting" in project "AlfaCarpeting") (in target 'AlfaCarpeting' from project 'AlfaCarpeting')
[05:38:22]: ▸ ❌  error: /Users/runner/runners/2.165.2/work/1/s/ios/Pods/Target Support Files/Pods-AlfaCarpeting/Pods-AlfaCarpeting.release.xcconfig: unable to open file (in target "AlfaCarpeting" in project "AlfaCarpeting") (in target 'AlfaCarpeting' from project 'AlfaCarpeting')
[05:38:22]: ▸ ❌  error: /Users/runner/runners/2.165.2/work/1/s/ios/Pods/Target Support Files/Pods-AlfaCarpeting/Pods-AlfaCarpeting.release.xcconfig: unable to open file (in target "AlfaCarpeting" in project "AlfaCarpeting") (in target 'AlfaCarpeting' from project 'AlfaCarpeting')
[05:38:22]: ▸ ❌  error: No profiles for 'com.AlfaCarpeting' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.AlfaCarpeting'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'AlfaCarpeting' from project 'AlfaCarpeting')
[05:38:22]: ▸ ** ARCHIVE FAILED **

标签: react-nativeazure-devopsreact-native-iosfastlanefastlane-gym

解决方案


如果您在 xcode 中打开项目并转到Build Settings -> Signing您需要将“代码签名样式”调整为Manual。这是我最终得到的设置(注意 - 我正在使用 fastlane match 进行证书和配置文件管理):

在此处输入图像描述


推荐阅读