Reputation: 12945
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
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
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
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