Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native build failing with error code 65 and ___darwin_check_fd_set_overflow

I am trying to build a React Native app. I have already worked with other react native projects previously and haven't faced any issues. This time, I am not able to run the app.

I created a new react-native project with:

npx react-native init demoproject

and ran it with:

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

In the terminal, I got this error:

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening demoproject.xcworkspace. Run CLI with --verbose flag for more details.

When I tried running it with Xcode, I got this error:

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)

I tried these steps without any success.

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

Environments:

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

I have a few other react-native projects that I tried and they run successfully. They also run on the same react-native version(0.62.2)

Is there anyway to solve the issue? Will updating Xcode to another version like 11.4 or 11.6 solve the problem?

like image 929
codequestions Avatar asked Nov 11 '20 11:11

codequestions


People also ask

How are WebSockets polyfills initialized in React Native?

These polyfills are initialized as part of the react-native module that you include in your application through import React from 'react'. If you load another module that requires WebSockets, such as Firebase, be sure to load/require it after react-native: If you encounter a ShellCommandUnresponsiveException exception such as:

How to debug Xcode build error code 65?

We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening mobile.xcworkspace. Run CLI with --verbose flag for more details.

Is there a way to fix the source code of React-Native?

There is a CocoaPods plugin called cocoapods-fix-react-native which handles any potential post-fixing of the source code due to differences when using a dependency manager.

How to fix NPM warn locking error EACCES while using React Native CLI?

If you encounter an error such as npm WARN locking Error: EACCES while using the React Native CLI, try running the following: If you added React Native manually to your project, make sure you have included all the relevant dependencies that you are using, like RCTText.xcodeproj, RCTImage.xcodeproj.


2 Answers

You have to remove Flipper Pod from file goto Your Project Folder->ios->Podfile and comment Flipper from that file as below

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

Now from ios folder enter below command in terminal

 pod install

It will fix this issue.

like image 71
Chavda jaydeep Avatar answered Oct 16 '22 18:10

Chavda jaydeep


A temporarily workaround:

  1. Comment all flipper functions in podfile;
  2. Remove flipperInit in appDelegate.m;
  3. Run pod install inside ios folder;
  4. Clean project;
  5. Run project again.
like image 41
Marcos Demétrio Avatar answered Oct 16 '22 17:10

Marcos Demétrio