Kureev / react-native-blur

React Native Blur component
MIT License
3.76k stars 556 forks source link

Invariant Violation: Native component for "BlurView" does not exist #275

Open jkobject opened 6 years ago

jkobject commented 6 years ago

Hi,

I have this error, maybe the fact I am using react-native-web is causing it but I don't see why, I have followed the steps described in the ReadMe and tried on ios and android with the same error

This error is located at:
    in BlurView (at BlurView.android.js:63)
    in BlurView (at App.js:529)
    in RCTView (at View.js:60)
    in View (at App.js:525)
    in App (at registerRootComponent.js:35)
    in RootErrorBoundary (at registerRootComponent.js:34)
    in ExpoRootComponent (at renderApplication.js:33)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:122)
    in AppContainer (at renderApplication.js:32)

the code is

return (
            <View style={styles.container} 
            ref={(ref) => { this.background = ref; }} 
            onLoadEnd={() => {this.setState({'viewRef':findNodeHandle(this.background)});}}
            {...this._panResponder.panHandlers}> 
      <BlurView
                style={styles.absolute}
                viewRef={this.state.viewRef}
                blurType="light"
                blurAmount={10}
        />
                {this.showBubbles()}
            </View>
        );

Thx

jpamarohorta commented 6 years ago

This happened to me also and I'm not using react-native-web.

It seems react-native link didn't worked as expected. I had to manually link the XCode project and the binaries. It solved it.

jkobject commented 6 years ago

Yes, the thing is that it is a CRNA app so it won't work with react-native link plugins, I need to npm run eject which will create the XCode project and Android one, to have it work.

VladyslavKochetkov commented 5 years ago

For some reason in this project react-native link doesn't work. The following solves this issue. Open XCode, go to your workspace. Right click on your project and press on Add files to "<project name". Go to node_modules -> react-native-blur -> ios and select RNBlur.xcodeproj and press Add. Press on your project go to Build Phases -> Link Binary with Libraries press on the + and add libRNBlur.a. Now it should work