我想使用fastlanegithub actions从reaction原生应用程序自动构建IOS版本.我遵循此链接安装了.p12 certifcate文件和扩展名为.mobileprovision的Provisioning Profile文件.然而,当我在github操作上运行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 }}

Install app certificate and provisioning profile is ok

The sigh works

The provisioning profile installed

All the steps before build_app are ok

The beginning of build_app step

And, the error

And another pic for fastlane error

推荐答案

经过大量的调查和搜索.我在这里找到了解决方案Github issue

我使用了match并禁用了update_code_signing_settings的自动代码签名,最后按照链接建议的方式使用了gym.

Ios相关问答推荐

Fastlane,iOS Provisioning Profile推送通知权限(通过示例)&

为什么AVSpeechSynthesizer复制的信息比我的文本多?

如何在@AppStorage中存储字体?

封装 Swift 导入

如何结合`@dynamicMemberLookup`和`ExpressibleByStringInterpolation`来实现方法链?

@Query与SwiftData数据列表绑定

iOS 16.4 更新后 Xcode 14.3 构建错误:找不到 libarclite_iphoneos.a,链接器命令失败

更新 flutter 和 xcode 后 Xcode 14.3 中缺少文件 (libarclite_iphoneos.a)

从 PHAssets 生成图像时,iOS 应用程序因内存问题而崩溃

iOS 如何使用 Alamofire 解析 JSON 可编码数组

叠加视图不在堆栈中维护自身 - SwiftUI

AppCenter 错误:/usr/bin/xcodebuild 失败,返回码:65

SwiftUI Select 器值在超过最大值时重置

在 UICollectionView 上动态设置布局导致莫名其妙的 contentOffset 变化

Xcode intellisense 彩色框中字母的含义,如 f、T、C、M、P、C、K、# 等

针对 Xcode 中的 iPad 选项

如何找出用于构建 *.ipa 文件的配置文件?

UITableView:从空白部分隐藏标题

请在您的 Podfile 中为此目标指定一个平台?

如何检测快速touch 或单击的tableView单元格