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

[Android] Crash after update from 5.1.3 to 5.1.5

Open mlecoq opened this issue 5 years ago • 11 comments

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)

mlecoq avatar Oct 02 '19 14:10 mlecoq

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

ridvanaltun avatar Oct 07 '19 22:10 ridvanaltun

same as me. and whenever changing tab in react navigation, it causes the crash.

gomdolkim avatar Oct 08 '19 06:10 gomdolkim

I tested v5.1.4, it works fine.

ridvanaltun avatar Oct 08 '19 06:10 ridvanaltun

It seems a problem of AndroidPdfViewer lib. https://github.com/barteksc/AndroidPdfViewer/issues/822

wonday avatar Oct 09 '19 15:10 wonday

Same here

kesha-antonov avatar Oct 09 '19 23:10 kesha-antonov

any workaround for this one?

mohammadalijf avatar Oct 11 '19 17:10 mohammadalijf

Pls use v5.1.4

wonday avatar Oct 12 '19 15:10 wonday

Is this solved in 6.0.0?

kesha-antonov avatar Nov 08 '19 17:11 kesha-antonov

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?

rohit75 avatar Jul 13 '20 16:07 rohit75

Any Solution?

YOEL311 avatar Dec 26 '21 11:12 YOEL311