user1072337
user1072337

Reputation: 12945

React Native - BVLinearGradient - 'React/RCTViewManager.h' file not found

I am running my React Native app in the iOS Simulator, and I am trying to use BVLinearGradient. I followed all of the instructions in the GitHub ReadMe, but I am receiving an error related to BVLinearGradient.

In the developer console, I am seeing:

Warning: Native component for "BVLinearGradient" does not exist

When I run directly from XCode, I see:

'React/RCTViewManager.h' file not found` (in BVLinearGradientManager.h)
'React/RCTView.h' file not found` (in BVLinearGradient.h)

What is happening here?

Upvotes: 9

Views: 11837

Answers (2)

Santiago Bendavid
Santiago Bendavid

Reputation: 999

I had the exact same issue a few days ago. The problem is that React is not linked yet when building the app. Try this:

Go to Product => Scheme => Manage Schemes... => Click on your app Scheme (usually the first one on the list) and click Edit => Go to the Build tab => Uncheck Parallelize Build

Then Click on the + sign to add a target => Search for React, select the first target called React and click on Add

Add React to targets list

Then select React in the targets list and drag it up to be first in that list.

Then go to Product => Clean and build your project again.

That should help.

Upvotes: 7

Jason Gaare
Jason Gaare

Reputation: 1511

I looks like you simply do not have the library linked correctly. A couple things to check:

  • Make sure your in your package.json you have "react-native-linear-gradient": "2.0.0" (you may have perhaps forgotten --save when you installed?

  • If you recently updated to >0.40 you might really want to clean your Xcode project (Product --> Clean) and it might help to clean your build folder too (Product --> hold option on your keyboard --> Clean Build folder)

  • Check your build scheme, it looks like the library might not be able to find React meaning perhaps it hasn't been built yet. This can be the case if you are NOT installing via Cocoapods. Follow the steps found in this comment: https://github.com/facebook/react-native/issues/11721#issuecomment-270672904

Good luck! Hope this helps.

Upvotes: 0

Related Questions