IOS build failed ‘Undefined symbols for architecture x86_64’

Updated React-Navigation to 3.0.8 and followed the instruction to install the react-native-gesture-handler.
after react-native link react-native-gesture-handler
i got error when building with react-native run-ios or building in the xCode.

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RNForceTouchHandler", referenced from:

      objc-class-ref in libRNGestureHandler.a(RNGestureHandlerManager.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 am using following packages:

  "react-native": "0.57.3",
    "react-native-gesture-handler": "1.0.12",
    "react-navigation": "3.0.8"

How do i fix this? Please help.
Appreciate 🙂

5 thoughts on “IOS build failed ‘Undefined symbols for architecture x86_64’

  1. @osdnk
    finally got project compiled in xcode with a clean build.
    I have to run this first.

    rm -rf ~/Library/Developer/Xcode/DerivedData/*
    

    Then building is ok.

    However, running react-native run-ios still give me that error. Wondering if that is caused by npm cache?

  2. xcode build success, but RN failed

    building with react-native run-ios or building in the xCode.

    delete RN project directory: ${root}/ios/build

  3. I was getting the same issue, but after next steps I got it resolved:

    1. Close the Metro bundler
    2. rm -rf ~/Library/Developer/Xcode/DerivedData/*
    3. Product -> Clean Build Folder
    4. Build from xcode

    I’ve managed to compile and run the build with the latest 1.0.15 version, both on device and emulator.

    "react-native": "0.57.7"
    "react-native-gesture-handler": "1.0.15"