react-native-pdf
react-native-pdf copied to clipboard
Invariant Violation: requireNativeComponent: "RNCProgressBar" was not found in the UIManager.
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 :
- Steps to reproduce the issue or to explain in which case you get the issue
- 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,
}
});
Getting same issue...
Same here...
Yes for me too on Android and iOS
please check and install these two packages
- https://github.com/react-native-progress-view/progress-view
- https://github.com/react-native-progress-view/progress-bar-android#readme
Thanks @vikas5914 i've install @react-native-community/progress-bar-android and update @react-native-community/progress-view and this seems to be resolved ! :)
@vikas5914 I have the same issue but the installations still don't fix the issue. I'm work with expo framework too.
Same issue, adding above packages did not solve. Using expo.
@Schmutsi @smpringl Expo framework does not support native modules. You guys need to Eject from Expo if you want to use this package.
Thank tou for your answer
same here