运行IOS Simulator后找不到YogaKit.modulemap

时间:2020-08-05 08:22:20

标签: ios xcode

我在XCode中运行IOS模拟器时遇到问题,每次尝试运行模拟器时,都会收到一条错误消息:

"fatal error: module map file '/Users/maurice/Library/Developer/Xcode/DerivedData/feedIt-etmfdpwrwadziocunpypqhkwucsd/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found"

预期的行为: XCode运行模拟器。

实际行为: 构建失败,我得到了描述的错误消息。

我已经尝试过更新Pod并删除“派生数据”,但是显然那是行不通的。

如何解决此问题?

我正在MacOS 10.15.5和XCode 11.6上运行

感谢您的帮助。 问候, 莫里斯Error Message

6 个答案:

答案 0 :(得分:5)

根据此issue中的注释,问题可能是您打开了.xcodeproj而不是.xcworkspace。其他建议的修复程序包括:

  1. 确保您的cocoapods构建目标与项目构建目标的版本相同。 link
  2. 尝试重新启动计算机。 link
  3. 检查您的Podfile,以确保其中包含您的构建方案。 link

尝试从命令行构建项目时遇到了类似的问题,根本问题是我使用的是.xcodeproj而不是.xcworkspace。据我所知,该错误可能是由多种不同的因素引起的。

答案 1 :(得分:1)

我的问题不是设置 VALID_ARCHS = "arm64 arm64e armv7 armv7s x86_64";像这样在 xyzApp/ios/xyzApp.xcodeproj/project.pbxproj

答案 2 :(得分:1)

我通过将值为 arm64 的 Debug Any iOS Simulator SDK 添加到 Pods 项目(苹果 MacBook 临 m1)

答案 3 :(得分:0)

如果您使用的是 M1 芯片 Mac,请将其添加到您的 Podfile 中

    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end

答案 4 :(得分:0)

尝试使用以下命令在终端上运行项目: npx react-native run-ios 然后再次在 Xcode 上运行它

答案 5 :(得分:0)

所描述的解决方案将在 Apple 芯片上 100% 运行,同时在没有 rosetta 的情况下运行 Xcode。

请仅尝试必要的步骤,但如果仍然无效,请尝试所有步骤,包括必要和不必要的步骤。

1 - 不重要(Package.json)

"dependencies": {
 "react": "17.0.1",
 "react-native": "0.64.2"
}

2 - 必要

  use_flipper!()
  post_install do |installer|
    react_native_post_install(installer)
        installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] =  "arm64"
        end
  end

  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
      installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
          end
      end
  end

3 - 在 Architectures->Excluded Architectures

下添加 arm64

4 - 在你的项目下添加一个 swift 文件,可以是空的,可以是 BridgingFile.swift(里面没什么特别的),这会触发一个桥接头。 Wallah,给你。

enter image description here