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

PDF not loading in Android V12

Open RaviHadalgi opened this issue 3 years ago • 2 comments

What react-native version are you using? "0.67.3 What react-native-pdf version are you using? 6.5.0 + What platform does your issue occur on? (android/ios/both) Both Describe your issue as precisely as possible :

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

    Trying to render the pdf from a url, similar to the example provided in docs const source = { uri: 'http://samples.leanpub.com/thereactnativebook-sample.pdf', cache: true }; The pdf works perfect in Emulation or devices running older android version, but not in actual device running on Android 12.

  2. Interesting logs None.

Show us the code you are using? const pdfUrl = {uri: ‘actual_path’,cache: true}; <Pdf ref={pdf => { this.pdf = pdf; }} trustAllCerts={false} source={pdfUrl} onLoadComplete={numberOfPages => { this.setState({ ….. }); }} onPageChanged={page => { this.setState({ ……. }); }} onError={error => { this.setState({ . ….. }); }} style={styles.pdf} />

Device tested (Oneplus 9, Oneplus 10R, Android V12).

Working on RealMe, Samsung devices running on Android V11.

RaviHadalgi avatar Aug 04 '22 08:08 RaviHadalgi

maybe related to: https://github.com/RonRadtke/react-native-blob-util/issues/166 ?

quarkcore avatar Aug 10 '22 13:08 quarkcore

I had the same issue and solved by doing this:

https://github.com/wonday/react-native-pdf/issues/648

Maybe you can try that too?

inveon-mehmetoksuz avatar Oct 04 '22 15:10 inveon-mehmetoksuz