【问题标题】:react-native build failing with error code 65 and ___darwin_check_fd_set_overflowreact-native 构建失败,错误代码为 65 和 ___darwin_check_fd_set_overflow
【发布时间】:2021-02-23 09:35:47
【问题描述】:

我正在尝试构建一个 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

我尝试了其他一些 react-native 项目,它们运行成功。它们也运行在相同的 react-native 版本(0.62.2)上

有没有办法解决这个问题?将 Xcode 更新到 11.4 或 11.6 等其他版本会解决问题吗?

【问题讨论】:

    标签: ios xcode macos react-native xcodebuild


    【解决方案1】:

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

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

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

     pod install
    

    它会解决这个问题。

    【讨论】:

    • 谢谢,@Chavda 这是我一直在寻找的答案
    【解决方案2】:

    临时解决方法:

    1. 在 podfile 中注释掉所有的 Flipper 函数;
    2. 删除 appDelegate.m 中的 FlipperInit;
    3. 在 ios 文件夹中运行 pod install;
    4. 清理项目;
    5. 再次运行项目。

    【讨论】:

      【解决方案3】:

      我解决了这个问题

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

      使用_flipper!

      post_install 做 |installer|

      flipper_post_install(安装程序)

      结束

      2.运行pod install

      3.运行项目。

      这解决了我的问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-09-30
        • 1970-01-01
        • 2016-05-28
        • 1970-01-01
        • 2023-04-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多