Loren Loren - 2 months ago 8
iOS Question

How do you debug linking errors in React Native iOS?

For instance RCTImageLoader being undefined:

enter image description here

It's part of the Image library in RN:

enter image description here

And I have this in my

Podfile
:

have this line in my Podfile:
pod 'React', :subspecs => ['Core', 'RCTImage', 'RCTNetwork', 'RCTLinkingIOS', 'RCTText', 'RCTWebSocket'], :path => '../node_modules/react-native'


And here are my libraries:
enter image description here

I have tried:


  • Project -> Clean

  • running
    pod install
    again

  • deleting
    Podfile.lock
    &&
    pod install

  • fresh git clone,
    npm install && cd ios && pod install


Answer

You can also try manually adding header files, for instance ../node_modules/react-native/Libraries/Image/RCTImageLoader.h.

However in my case, that didn't help. The solution was to open MyProject.xcworkspace instead of MyProject.xcproject

Comments