react-native-svg: React/UIView+React.h file not found

Installed latest version using yarn add react-native-svg. Using React v15.3.1 and RN v0.39.2. Ran react-native link react-native-svg and everything seemed to be working.

When building in XCode I’m getting the following error: Lexical or Preprocessor Issue: React/UIView+React.h file not found

I checked and libRNSVG.a is in Link Binary With Libraries

Any ideas what i’m doing wrong? Thanks

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 17
  • Comments: 40

Most upvoted comments

my version is correct, but had same problem. and I solve this by:

1. react-native unlink react-native-svg
2. add pod 'RNSVG', :path => '../node_modules/react-native-svg' to my pod file

Using react-native-svg@4.4.1 worked for me (with RN@0.39.2)

@superstarwulin react-native-svg >= 4.5.0 only supports react-native >= 0.40.0 and react >= 15.4.0 You can upgrade react-native to 0.40.0 or downgrade react-native-svg.

After upgrading react-native@0.40.0 and react-native-svg>=4.5.0 try: Clean XCode project and run

react-native upgrade
react-native link

FYI upgrading react-native to 0.55.4 fixed the header issue but crashing at runtime.

@maxkomarychev will try that from a fresh CRNA project

same here:

"react-native": "0.50.4",  
"react-native-svg": "^6.0.0"
pod 'RNSVG', :path => '../../node_modules/react-native-svg', :inhibit_warnings => true 
pod 'React', :git => '../../node_modules/react-native', :inhibit_warnings => true, :subspecs => [
'Core',
'BatchedBridge', # needed for loading bundle I think
'DevSupport', # needed for debugging menu
'RCTAnimation', # needed for react-navigation
'RCTImage', # needed for react-navigation
'RCTLinkingIOS', # needed for linking libraries
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
] 
pod 'yoga', :path => '../../node_modules/react-native/ReactCommon/yoga', :inhibit_warnings => true

when pod install, throw error alt text

anyone help me?? thanks!!!