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

I am running a React Native app in iOS Simulator and I am trying to use BVLinearGradient. I followed all the instructions in the ReadMe github, but I get an error related to BVLinearGradient.

In the developer console, I see:

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's going on here? Thanks.

+5
source share
2 answers

It looks like you simply do not have the appropriate library. A couple of things to check:

  • Make sure you have package.json , you have "react-native-linear-gradient": "2.0.0" (maybe you lost --save during installation?

  • If you recently upgraded to >0.40 , you may really want to clear the Xcode project (Product → Clean), and this can help also clear the build folder (Product → hold on your keyboard → Clean Build)

  • Check the assembly diagram, it looks like the library will not be able to find React , which means that it has not yet been built. This may be the case if you do NOT install through Cocoapods. Follow the steps described in this comment: https://github.com/facebook/react-native/issues/11721#issuecomment-270672904

Good luck Hope this helps.

+1
source

I had the same problem a few days ago. The problem is that React is not yet associated with building the application. Try the following:

Go to Product => Schema => Schema Management ... => Click on your application scheme (usually the first one on the list) and click Change => Go to the Assembly tab = Uncheck the box "Parallel assembly"

Then click the + sign to add the target => Search for an answer, select the first target named React and click Add

Add answer to goal list

Then select React in the goal list and drag it to be the first in the list.

Then go to Product => Clean and create the project again.

This should help.

+1
source

Source: https://habr.com/ru/post/1266526/


All Articles