React-Native: Apple Mach-O Linker Error, Directory not found for CocoaAsyncSocket

Viewed 676

Having problems with react native. Getting this error when compiling with xcode:

ld: warning: directory not found for option '-L-L/Users/username/Library/Developer/Xcode/DerivedData/InterfacingConsumerHealthPeripherals-gbyevwticojtxmcicmilnnmtlowd/Build/Products/Debug-iphonesimulator/CocoaAsyncSocket'
ld: library not found for -lCocoaAsyncSocket
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am unsure whats wrong. I have reset my podfile and node_modules many times. Tried other solutions removing linked binaries and flipper. I have tried npm install and removing library search paths. Nothing seems to work.

My PodFile:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.0'

target 'InterfacingConsumerHealthPeripherals' do
  use_unimodules!
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])
  #use_frameworks!  

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!({ 'Flipper' => '0.74.0' })




  post_install do |installer|
    flipper_post_install(installer)
  end
end

My Dependencies

"dependencies": {
    "@react-native-async-storage/async-storage": "^1.13.4",
    "@react-native-community/art": "^1.2.0",
    "@react-native-community/cli-platform-ios": "^4.13.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/bottom-tabs": "^5.11.1",
    "@react-navigation/drawer": "^5.11.2",
    "@react-navigation/native": "^5.8.9",
    "@tensorflow/tfjs": "^3.0.0",
    "@testing-library/react-native": "^7.1.0",
    "@tradle/react-native-http": "^2.0.1",
    "@unimodules/react-native-adapter": "^5.4.0",
    "assert": "^2.0.0",
    "asyncstorage-down": "^4.2.0",
    "base64-arraybuffer": "^0.2.0",
    "expo": "^37.0.12",
    "expo-application": "^2.3.0",
    "expo-auth-session": "^3.1.0",
    "expo-constants": "^10.0.1",
    "expo-linking": "^2.1.1",
    "expo-random": "^9.0.1",
    "expo-secure-store": "^9.2.0",
    "expo-splash-screen": "~0.6.2",
    "expo-status-bar": "~1.0.2",
    "expo-updates": "~0.3.2",
    "jest-expo": "^38.0.2",
    "jest-fetch-mock": "^3.0.3",
    "moment": "^2.29.1",
    "react": "16.13.1",
    "react-devtools": "^4.10.0",
    "react-dom": "16.13.1",
    "react-native": "~0.63.3",
    "react-native-calendar-picker": "^6.1.5",
    "react-native-dialog": "^6.1.2",
    "react-native-elements": "^3.0.0-alpha.1",
    "react-native-gesture-handler": "~1.7.0",
    "react-native-os": "^1.2.6",
    "react-native-randombytes": "^3.6.0",
    "react-native-reanimated": "^1.7.0",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "3.1.4",
    "react-native-screens": "~2.10.1",
    "react-native-svg": "9.0.1",
    "react-native-testing-library": "^6.0.0",
    "react-native-udp": "^4.1.2",
    "react-native-unimodules": "^0.9.1",
    "react-native-vector-icons": "^7.1.0",
    "react-native-web": "^0.15.0",
    "react-navigation": "^4.4.3",
    "react-navigation-drawer": "^2.6.0",
    "rn-apple-healthkit": "^0.8.0",
    "stream-browserify": "^3.0.0",
    "timers-browserify": "^2.0.12",
    "tty-browserify": "0.0.1",
    "url": "^0.11.0",
    "util": "^0.12.3",
    "victory-native": "^35.3.1",
    "wav-decoder": "^1.3.0"
  }

Any help is appreciated :). Unsure whats wrong

1 Answers

Instead of use_flipper!({ 'Flipper' => '0.74.0' }) in your pod file, use:

use_flipper!({ 'Flipper-Folly' => '2.3.0' })

  • then delete your Podfile.lock
  • inside the ios folder in terminal run pod install
  • go back to the project folder and run react-native run-ios or npx react-native run-ios depending on your environment.
Related