react-nativegradient

BVLinearGradient was not found in the UIManager?


There is documentation about this, but it is for macOs only. https://github.com/react-native-community/react-native-linear-gradient.

I linked the library by running npm install react-native link react-native-linear-gradient.

I don't understand this i dont have a ios folder, i installed pod but my ios folder remained empty:

iOS For React Native >= 0.60.0 run the following command in the ios/ folder and skip the rest of the section.

pod install CocoaPods Add the following line to your Podfile:

pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient' or:

This below is only for macOs ?

Manually Open your project in Xcode, right click on Libraries and click Add Files to "Your Project Name" Look under node_modules/react-native-linear-gradient/ios and add BVLinearGradient.xcodeproj. (Screenshot 1) (Screenshot 2). Add libBVLinearGradient.a to Build Phases -> Link Binary With Libraries (Screenshot 1) (Screenshot 2). Click on BVLinearGradient.xcodeproj in Libraries and go the Build Settings tab. Double click the text to the right of Header Search Paths and verify that it has $(SRCROOT)/../react-native/React - if it isn't, then add it. This is so Xcode is able to find the headers that the BVLinearGradient source files are referring to by pointing to the header files installed within the react-native node_modules directory. (Screenshot).

How to do it in Windows and i don't have an ios map inside node_modules/react-native-linear-gradient/?

how can I make it work?


Solution

  • Check whether these two lines are in your 'package file'.

    'React', :path => '../node_modules/react-native'

    'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'

    If yes then --

    Run "pod install" under $project path/ios before react-native run-ios.