react-native-linear-gradient: requireNativeComponent: "BVLinearGradient" was not found in the UIManager.

Bug report

I am tried so many ways but not able to resolve this issue please help me. Simulator Screen Shot - iPhone 11 Pro Max - 2020-10-01 at 13 14 06

Summary

Environment info

react-native info output:

# paste it here

Library version: x.x.x

Steps to reproduce

Describe what you expected to happen:

Reproducible sample code

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 10
  • Comments: 31

Most upvoted comments

Please,How to solve it on Android?

@hu-qi After installing package with npm, you have to rebuild your project, Just run: npm run android or npm run ios

after trying this you get your problem solved!! step 1- npm install expo-linear-gradient setp 2*- import { LinearGradient } from expo-linear-gradient step 3*- you can use both format now ,

<LinearGradient colors={[‘#7df3ff’,‘#05e6fc’,‘#00c1d4’]} style={{height:“45%”,width:“25%”, padding:10, borderRadius:10, marginLeft:“60%”,

                    }}
                    >             
                            <Text>Get Started</Text>
                 </LinearGradient>

-------------OR------------- <LinearGradient
colors={[‘#7df3ff’,‘#05e6fc’,‘#00c1d4’]} style={{ }} /> <View> {your code }</View>

Thank you !!!

Solve my issue.

cd ios
pod install
cd ..
react-native run-ios

Installing pod solved my issue npm install react-native-linear-gradient --save cd ios && pod install && cd … Screenshot 2020-10-03 at 12 39 42 AM

step 1- npm install expo-linear-gradient setp 2- import { LinearGradient } from expo-linear-gradient

import linear-gradient using above code that error will resolve Its Worked For Me!

FULL CODE HERE!!!

import * as React from ‘react’; import { StyleSheet, Text, View } from ‘react-native’; import { LinearGradient } from ‘expo-linear-gradient’;

export default function App() { return ( <View style={styles.container}> <LinearGradient // Background Linear Gradient colors={[‘rgba(0,0,0,0.8)’, ‘transparent’]} style={styles.background} /> <LinearGradient // Button Linear Gradient colors={[‘#4c669f’, ‘#3b5998’, ‘#192f6a’]} style={styles.button}> <Text style={styles.text}>Sign in with Facebook</Text> </LinearGradient> </View> ); }

i have same problem,my react-native edition is 0.66.4,install react-native-linear-gradient edition is 2.5.6.i execute step1:yarn add react-native-linear-gradient.step2:cd ios .step3:npx pod install . After executing the above command, I restarted npm run ios,but now still report error,please help me !!

解决了吗,求助下

image

how to resolve this error in expo project.