【问题标题】:Xcode Cloud: unable to open configuration settings fileXcode Cloud:无法打开配置设置文件
【发布时间】:2022-11-10 17:36:09
【问题描述】:

我正在处理一个 React Native 项目,设置 Xcode Cloud 构建。

我不断收到此错误:

unable to open configuration settings file
Pods-XXX.debug.xcconfig:1

我的工作区中的文件如下所示:

|-- XXX
|-- Pods
|.  -- Podfile
|.  -- Targets Support Files
|.     -- Pods-XXX
|.        -- Pods-XXX.debug

【问题讨论】:

标签: xcode react-native xcode-cloud


【解决方案1】:

你猜怎么着? XCode 是垃圾,但 doc 可以在这里帮助我们。

这就是我用来顺利构建我的工作流程的方法。我将在这里分享确切的 bash 脚本。

为什么会失败?

  1. 首先在您的工作流窗口侧栏上打开日志。

  2. 在运行存档过程之前检查您是否正在安装必要的依赖项。您正在使用虚拟机,因此默认情况下不会在那里安装任何依赖项,如 cocoapods 或 yarn。

    如果您还没有阅读并跳到解决方案:

    以下是步骤:

    1. 在 ios 文件夹中创建 ci_scripts 文件夹。

    2. 在ci_scripts 文件夹中创建 3 个文件:

      1. ci_post_clone.sh
      2. ci_post_xcodebuild.sh
      3. ci_pre_xcodebuild.sh
      4. 在您的 ci_post_clone.sh 文件中添加以下内容:

         #!/bin/zsh
        
         # fail if any command fails
        
         echo "? Stage: Post-clone is activated .... "
        
         set -e
         # debug log
         set -x
        
         # Install dependencies using Homebrew. This is MUST! Do not delete.
         brew install node yarn cocoapods fastlane
        
         # Install yarn and pods dependencies.
         # If you're using Flutter or Swift 
         # just install pods by "pod install" command 
         ls && cd .. && yarn && pod install
        
         echo "? Stage: Post-clone is done .... "
        
         exit 0
        
      5. 在您的 ci_pre_xcodebuild.sh 文件中添加以下内容:

         #!/bin/zsh
        
         echo "? Stage: PRE-Xcode Build is activated .... "
        
         # You can additional scripts here...
        
         echo "? Stage: PRE-Xcode Build is DONE .... "
        
         exit 0
        
      6. 在您的 ci_post_xcodebuild.sh 文件中添加以下内容:

         #!/bin/zsh
        
         echo "? Stage: POST-Xcode Build is activated .... "
        
         # You can additional scripts here...
        
         echo "? Stage: POST-Xcode Build is DONE .... "
        
         exit 0
        

【讨论】:

  • 我现在正在构建。会告诉你这件事的进展的。
【解决方案2】:

我最近遇到了同样的问题,现在有一个用于 xcode 云的默认工作流程,它执行@BEK ROZ 提供的克隆后步骤

在使用 Ionic/Capacitor 构建 VueJS 应用程序时,我在本地也遇到了同样的问题

在此之前,我对 iOS 构建的了解完全为零,所以请原谅我的无辜,但我发现问题与 *xcconfig 文件有关。使用 npm 安装的每个电容器模块都有自己的 xcconfig 文件用于调试和发布 - 存储在:

ios/App/Pods/Target Support Files/{{ Module Name }}/{{ Module Name }}.debug.xcconfig

ios/App/Pods/Target Support Files/{{ Module Name }}/{{ Module Name }}.release.xcconfig

我只安装了两个插件,所以我卸载了其中一个,它是cordova-plugin-screen-orientation,同步然后存档(下面的步骤),这次它通过了。

# Remove a capacitor module with npm e.g. cordova-plugin-screen-orientation
npm uninstall cordova-plugin-screen-orientation

# Sync the iOS plugins to remove the plugin from your Podfile (ios/App/Podfile)
npx cap sync ios

因此,我建议您检查您已安装的所有插件,看看它们是否正在播放。然后回到 xcode,从菜单中运行“Product -> Archive”以开始新的构建或推送您的更改,让 xcode cloud 为您完成繁重的工作。

祝你好运

【讨论】:

    猜你喜欢
    • 2019-04-15
    • 2021-01-29
    • 2014-04-20
    • 1970-01-01
    • 2018-01-03
    • 1970-01-01
    • 1970-01-01
    • 2021-07-18
    相关资源
    最近更新 更多