无法构建Xcode项目:“ XCTest'不包含位码”

时间:2019-06-27 06:00:47

标签: xcode react-native react-native-ios

我已经生成了一个基本的本机项目,并配置了ios项目以使用Cocoa Pods。

当我运行react-native run-ios时,该项目可以正常运行并可以与iOS模拟器一起使用,但是如果我在Xcode中打开该项目并尝试在物理设备上构建并运行,我将得到以下信息:

ld: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我正在使用Xcode版本10.2.1,本机反应为0.59.8。

我是Xcode的新手,关于如何解决此问题的任何想法都将非常受欢迎!

其他信息

我对Xcode的配置了解不多,但是我尝试禁用Podfile中的位码。

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings['ENABLE_BITCODE'] = 'NO'
  end

  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

在安装Pod之后,清理并构建它导致另一个构建失败,链接器抱怨找不到特定文件。从podfile + clean + build中删除它再次导致原始错误。

0 个答案:

没有答案