react-native-pdf: Android Crash at PDF viewing

What react-native version are you using? 0.73.6 What react-native-pdf version are you using? 6.7.5 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
  2. Interesting logs

just using PDF component on Android crash the app.

LOGS:

Instabug Caught an Unhandled Exception: java.lang.NoClassDefFoundError
                                                                                                   java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/enums/EnumEntriesKt;
                                                                                                   	at io.legere.pdfiumandroid.util.AlreadyClosedBehavior.<clinit>(Config.kt:9)
                                                                                                   	at io.legere.pdfiumandroid.util.Config.<init>(Config.kt:14)
                                                                                                   	at io.legere.pdfiumandroid.util.Config.<init>(Unknown Source:2)
                                                                                                   	at com.github.barteksc.pdfviewer.PDFView.<init>(PDFView.java:314)
                                                                                                   	at org.wonday.pdf.PdfView.<init>(PdfView.java:85)
                                                                                                   	at org.wonday.pdf.PdfManager.createViewInstance(PdfManager.java:57)
                                                                                                   	at org.wonday.pdf.PdfManager.createViewInstance(PdfManager.java:28)
                                                                                                   	at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:176)
                                                                                                   	at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:108)
                                                                                                   	at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:281)
                                                                                                   	at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:194)
                                                                                                   	at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:920)
                                                                                                   	at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1037)
                                                                                                   	at com.facebook.react.uimanager.UIViewOperationQueue.-$$Nest$mflushPendingBatches(Unknown Source:0)
                                                                                                   	at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1097)
                                                                                                   	at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
                                                                                                   	at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
                                                                                                   	at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
                                                                                                   	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1035)
                                                                                                   	at android.view.Choreographer.doCallbacks(Choreographer.java:845)
                                                                                                   	at android.view.Choreographer.doFrame(Choreographer.java:775)
                                                                                                   	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
                                                                                                   	at android.os.Handler.handleCallback(Handler.java:938)
                                                                                                   	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                   	at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                   	at android.os.Looper.loop(Looper.java:288)
                                                                                                   	at android.app.ActivityThread.main(ActivityThread.java:7839)
                                                                                                   	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                   	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                                                                                                   	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Join a screenshot or video of the problem on the simulator or device? Crash!

Show us the code you are using?

<Pdf
						style={flex}
						renderActivityIndicator={(): ReactElement => <Spinner image={SpinnerImage.BLUE_SPINNER} isVisible={true} />}
						source={source}
						onError={(): void => setError(true)}
						trustAllCerts={false}
					/>

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 2
  • Comments: 18

Most upvoted comments

{pdfPath && ( <View> <Pdf ref={pdfRef} key={pdfPath} // Path file is key source={{ uri: file://${pdfPath} }}

when I load new document y clear the path and set the new pdfPath. The pdf component is visible only if have a path

So i am trying to load a pdf, it starts crashes the app as soon as loading completes

same +1