xcode构建失败,显示为:“ _ RCTSetLogFunction”,引用自AppTests.o中的-[AppTests testRendersWelcomeScreen]

Dei*_*ian 2 xcode build hyperlink ios

将xcode升级到10.1后,项目的编译失败,并显示以下信息:

ld: warning: directory not found for option '-L/Users/divanov/Desktop/<projectName> AppTests'
Undefined symbols for architecture arm64:
  "_RCTSetLogFunction", referenced from:
      -[AppTests testRendersWelcomeScreen] in AppTests.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

Dei*_*ian 10

以下工作对我有用:

  1. 在XCode中,在左侧面板中选择项目
  2. 点击“构建设置”
  3. 在“链接”部分中,找到“死代码剥离”部分,并将其更改为“否”
  4. 清洁和建造

***在另一个项目中,我遇到了相同的错误,但是在那种情况下,“失败目标的设置” /“构建阶段” /“链接二进制与”中的库丢失了,所以我不得不手动添加它们!