PDF not loading in Android V12
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 :
-
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.
-
Interesting
logsNone.
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.
maybe related to: https://github.com/RonRadtke/react-native-blob-util/issues/166 ?
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?