Search code examples
iosreact-nativereact-native-vector-icons

React Native iOS build issues while installing react-native-vector-icons


I am learning React Native and am at my wits end on this issue on my very first project. I am trying to install react-native-vector-icons and while everything works perfectly in Android, iOS wont run.

Here are the errors I get (happy to provide any other details that will help, but please remember I am new and may need you to walk me through what to type in to get it):

  1. In XCode i see this when I build: Apple Mach-O Linker Error; Library not found for -lCocoaAsyncSocket; Linker command failed with exit code 1 (use -v to see invocation)
  2. In terminal I see: 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 <appName>.xcworkspace

I have tried the following based on my web research:

  1. pod deintegrate && pod install (I also updated pod to the latest)
  2. I walked through all of the steps to install on the github site and even started up a second fresh project and walked through a youtube tutorial with the same results.
  3. I have cleaned the cache, deleted the build folder and tried to rebuild, deleted the podfile.lock folder and resinstalled, rebooted my machine entirely, ensured that i am opening the .xcworkspace file and not the .xcodeproj file, i have changed my build system workspace settings to legacy, i have linked and unlinked a dozen times.

Other data that might be useful:

  1. Here are my react versions: react-native-cli: 2.0.1 react-native: 0.63.2
  2. This happened when I tried to install react-native-maps but it somehow miraculously "fixed itself' after running the run-ios command for the 20th time.
  3. I am not sure that autolinking is working as I have to run react-native link <package> --platforms ios whenever i install a 3P package.

I would appreciate any help that can be provided and am happy to add in any detail needed (just please help me with how to get it).

Thanks in advance for any help you can provide!


Solution

  • This could happen if you are using react-native-vector-icons and the "Legacy build system" in Xcode. Try to switch to the "New Build System" in your Xcode workspace: See here for details