react-native-pdf icon indicating copy to clipboard operation
react-native-pdf copied to clipboard

Invariant Violation: requireNativeComponent: "RNCProgressBar" was not found in the UIManager.

Open mamunur121 opened this issue 4 years ago • 10 comments

What react-native version are you using? react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",

What react-native-pdf version are you using? "react-native-pdf": "^6.3.0", What platform does your issue occur on? (android/ios/both) android, "expo": "~40.0.0", Describe your issue as precisely as possible :

  1. Steps to reproduce the issue or to explain in which case you get the issue
  2. Interesting logs

Invariant Violation: requireNativeComponent: "RNCProgressBar" was not found in the UIManager.

This error is located at: in RNCProgressBar (at RNCProgressBarAndroid.android.js:43) in ForwardRef(ProgressBarAndroid) (at react-native-pdf/index.js:415)

Join a screenshot or video of the problem on the simulator or device?

Show us the code you are using?

import React from 'react';
import { StyleSheet, Dimensions, View } from 'react-native';

import Pdf from 'react-native-pdf';

export default class App extends React.Component {
  render() {
    const source = {uri:'http://samples.leanpub.com/thereactnativebook-sample.pdf',cache:true};
    //const source = require('./test.pdf');  // ios only
    //const source = {uri:'bundle-assets://test.pdf'};
    
    //const source = {uri:'file:///sdcard/test.pdf'};
    //const source = {uri:"data:application/pdf;base64,JVBERi0xLjcKJc..."};
    
    return (
      <View style={styles.container}>
        <Pdf
          source={source}
          onLoadComplete={(numberOfPages,filePath)=>{
            console.log(`number of pages: ${numberOfPages}`);
          }}
          onPageChanged={(page,numberOfPages)=>{
            console.log(`current page: ${page}`);
          }}
          onError={(error)=>{
            console.log(error);
          }}
          onPressLink={(uri)=>{
            console.log(`Link presse: ${uri}`)
          }}
          style={styles.pdf}/>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'flex-start',
    alignItems: 'center',
    marginTop: 25,
  },
  pdf: {
    flex:1,
    width:Dimensions.get('window').width,
    height:Dimensions.get('window').height,
  }
});

mamunur121 avatar Mar 25 '21 13:03 mamunur121

Getting same issue...

vanditmehta avatar Mar 26 '21 12:03 vanditmehta

Same here...

AtanvarnoJack avatar Apr 06 '21 15:04 AtanvarnoJack

Yes for me too on Android and iOS

shafiqshams avatar Apr 07 '21 15:04 shafiqshams

please check and install these two packages

  1. https://github.com/react-native-progress-view/progress-view
  2. https://github.com/react-native-progress-view/progress-bar-android#readme

vikas5914 avatar Apr 08 '21 06:04 vikas5914

Thanks @vikas5914 i've install @react-native-community/progress-bar-android and update @react-native-community/progress-view and this seems to be resolved ! :)

AtanvarnoJack avatar Apr 08 '21 07:04 AtanvarnoJack

@vikas5914 I have the same issue but the installations still don't fix the issue. I'm work with expo framework too.

Schmutsi avatar Apr 16 '21 09:04 Schmutsi

Same issue, adding above packages did not solve. Using expo.

smpringl avatar Apr 18 '21 00:04 smpringl

@Schmutsi @smpringl Expo framework does not support native modules. You guys need to Eject from Expo if you want to use this package.

vikas5914 avatar Apr 19 '21 06:04 vikas5914

Thank tou for your answer

Schmutsi avatar Apr 19 '21 07:04 Schmutsi

same here

hcmutemimi avatar Sep 24 '21 07:09 hcmutemimi