You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Fastlane+GitHub Actions构建React Native iOS应用失败:配置文件匹配错误

GitHub Actions + Fastlane构建React Native iOS版本时配置文件匹配失败

我使用Fastlane和GitHub Actions自动化构建React Native应用的iOS版本,已按指引安装了.p12证书文件和.mobileprovision格式的配置描述文件。GitHub Actions中Fastlane登录Apple Connect流程正常,但执行build_app步骤时出现如下报错:

Error: No profiles for 'com.bimsaudi.atarcloud' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.bimsaudi.atarcloud'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Atar' from project 'Atar')

Fastfile内容

default_platform(:ios)

platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do
  setup_ci

  auth_key_path = File.expand_path(File.join(File.dirname(__FILE__), '**.p8'))

  app_store_connect_api_key({
    key_id: "<key_id>",
    issuer_id: "<issuer_id>",
    key_filepath: auth_key_path,
  })
  increment_build_number(xcodeproj: "Atar.xcodeproj")
  build_app(workspace: "Atar.xcworkspace", scheme: "Atar")
  upload_to_testflight
end

lane :check_provisioning_profiles do
  setup_ci
  auth_key_path = File.expand_path(File.join(File.dirname(__FILE__), '**.p8'))

  app_store_connect_api_key({
    key_id: "<key_id>",
    issuer_id: "<issuer_id>",
    key_filepath: auth_key_path,
  })

  sigh(username: "<apple-username>")
end
  
end

.github/workflows/automation.yml内容

name: Test CD
on:
  push:
  workflow_dispatch:

jobs:
  build-ios:
    name: Build IOS
    runs-on: macOS-14

    steps:
      - name: Checkout repository
        uses: actions/checkout@v1

      - name: Install the Apple certificate and provisioning profile
        env:
          BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
          P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
          BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
          KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
        run: |
          # create variables
          CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
          PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
          KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db

          # import certificate and provisioning profile from secrets
          echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
          echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH

          # create temporary keychain
          security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
          security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
          security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

          # import certificate to keychain
          security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
          security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
          security list-keychain -d user -s $KEYCHAIN_PATH

          # apply provisioning profile
          mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
          cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles

      - name: Setup Node
        uses: actions/setup-node@v2
        with:
          node-version: '16.20.2'
          cache: 'yarn'

      - name: Install deps
        run: yarn --frozen-lockfile && yarn env

      - name: Install pods
        shell: bash
        run: cd ios/ && pod install && cd ..

      - name: Build IOS
        run: cd ios/ && fastlane ios check_provisioning_profiles && fastlane ios beta
        env:
          FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
          FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
          FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }}
          # FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}

相关操作验证显示:证书与配置文件安装正常、sigh命令执行成功、build_app之前的所有步骤无异常,但最终仍触发上述配置文件匹配错误。

内容的提问来源于stack exchange,提问作者mohamed saad

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.25 10:35:14