react-native构建失败,错误代码为65和___ darwin_check_fd_set_overflow

时间:2020-11-11 11:57:20

标签: ios xcode macos react-native xcodebuild

我正在尝试构建一个React Native应用程序。我以前已经与其他React Native项目合作过,并且没有遇到任何问题。这次,我无法运行该应用程序。

我创建了一个新的react-native项目:

npx react-native init demoproject

并运行:

cd demoproject
npx react-native start
npx react-native run-ios

在终端中,我收到此错误:

错误无法构建iOS项目。我们运行了“ xcodebuild”命令,但它退出,错误代码为65。要进一步调试构建日志,请考虑通过打开demoproject.xcworkspace使用Xcode.app构建您的应用程序。使用--verbose标志运行CLI以获取更多详细信息。

当我尝试使用Xcode运行它时,出现此错误:

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
  _RAND_poll in libcrypto.a(rand_unix.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我尝试了这些步骤,但没有成功。

react-native start --reset-cache
rm -rf node_modules/
rm -rf package-lock.json 
cd ios
pod deintegrate
cd ..
rm -rf ios/Podfile.lock 
npm install
npm audit fix
react-native link
cd ios
pod install
cd ..
react-native run-ios

环境:

Xcode: 11.2 (11B52)
OS: mac OS Catalina 10.15.1
react-native-cli: 2.0.1
react-native: 0.62.2

我尝试了其他一些本机反应项目,它们成功运行。它们还可以在相同的本机版本(0.62.2)上运行

反正有解决问题的方法吗?将Xcode更新到其他版本(如11.4或11.6)是否可以解决问题?

3 个答案:

答案 0 :(得分:2)

临时解决方法:

  1. 注释podfile中的所有鳍状肢功能;
  2. 在appDelegate.m中删除flipperInit;
  3. 在ios文件夹中运行pod install;
  4. 清理项目;
  5. 再次运行项目。

答案 1 :(得分:0)

您必须从文件goto中删除Flipper Pod 您的Project Folder-> ios-> Podfile并从该文件中注释Flipper,如下所示

 #use_flipper!
 #post_install do |installer|
   #flipper_post_install(installer)
 #end

现在从ios文件夹中的终端输入以下命令

 pod install

它将解决此问题。

答案 2 :(得分:0)

我用

解决了这个问题

1.在Podfile中注释掉下面提到的4个flipper函数行

use_flipper!

post_install 做 |安装程序|

flipper_post_install(安装程序)

结束

2.运行pod install

3.运行项目。

这解决了我的问题。