Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

  1. 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).
  2. Add libBVLinearGradient.a to Build Phases -> Link Binary With Libraries (Screenshot 1) (Screenshot 2).
  3. 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 can I do it in Windows and I don't have an iOS map inside node_modules/react-native-linear-gradient/?


2 Answers

Use this one if you are using expo

  1. Paste this in terminal window:

    expo install expo-linear-gradient
    
  2. Add the import statement to the file:

    import {LinearGradient} from 'expo-linear-gradient';
    
like image 190
Indika_Nuwan95 Avatar answered Sep 14 '25 06:09

Indika_Nuwan95


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.

like image 34
Himanshu Agrawal Avatar answered Sep 14 '25 04:09

Himanshu Agrawal