react-native-pdf
react-native-pdf copied to clipboard
[Android] Crash after update from 5.1.3 to 5.1.5
What react-native
version are you using?
0.59 (Expokit 35.0.0)
What react-native-pdf
version are you using?
5.1.5 (works fine with 5.1.3)
What platform does your issue occur on? (android/ios/both) Android
Describe your issue as precisely as possible : 1) Steps to reproduce the issue or to explain in which case you get the issue
I am using react navigation, I have one view which displays the pdf (uri is passed with navigation params)
const PDFScreen = ({ navigation }) => { const source = { uri: navigation.getParam('uri'), cache: true }; return ( <View style={styles.container}> <Pdf source={source} style={styles.pdf} maxScale={10} /> </View> ); };
when I go back from this page, the application crashes (on android simulator and device)
2) Interesting logs
2019-10-02 16:18:31.646 5581-5581/com.archireport.arlive E/AndroidRuntime: FATAL EXCEPTION: main Process: com.archireport.arlive, PID: 5581 java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.HandlerThread.isAlive()' on a null object reference at com.github.barteksc.pdfviewer.PDFView.loadComplete(PDFView.java:756) at com.github.barteksc.pdfviewer.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:80) at com.github.barteksc.pdfviewer.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:27) at android.os.AsyncTask.finish(AsyncTask.java:695) at android.os.AsyncTask.access$600(AsyncTask.java:180) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193)
FATAL EXCEPTION: main
Process: com.salescomplete.mobile, PID: 9976
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.HandlerThread.isAlive()' on a null object reference
at com.github.barteksc.pdfviewer.PDFView.loadComplete(PDFView.java:756)
at com.github.barteksc.pdfviewer.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:80)
at com.github.barteksc.pdfviewer.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:27)
at android.os.AsyncTask.finish(AsyncTask.java:695)
at android.os.AsyncTask.-wrap1(Unknown Source:0)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7000)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
I get same error while same reason. When i return to screen this error occour.
react-native: 0.61.1 react-native-pdf: 5.1.5 rn-fetch-blob: 0.11.2
same as me. and whenever changing tab in react navigation, it causes the crash.
I tested v5.1.4, it works fine.
It seems a problem of AndroidPdfViewer lib. https://github.com/barteksc/AndroidPdfViewer/issues/822
Same here
any workaround for this one?
Pls use v5.1.4
Is this solved in 6.0.0
?
Same Issue here for following version react-native: 0.59.10 react-native-pdf: 5.1.4 rn-fetch-blob: 0.11.2
Any Solution?
Any Solution?