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?
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:
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.
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.
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.
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.
A temporarily workaround:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With