You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Crash on Android When Closing PDF Page After Scrolling || java.lang.IllegalStateException: Already closed #987
We are encountering an app crash on Android devices when a user is viewing a PDF using react-native-pdf and closes the page after scrolling through it. The issue is consistently reported in Firebase with an IllegalStateException: Already closed error in the stack trace.
Steps to Reproduce:
Open a PDF with the react-native-pdf component.
Scroll or slide through multiple pages.
Close the PDF viewing page (e.g., by navigating away or closing the screen).
The app crashes.
Stack Trace (Firebase Report):
E FATAL EXCEPTION: PDF renderer
Process: com.app, PID: [varies]
java.lang.IllegalStateException: Already closed
at io.legere.pdfiumandroid.util.ConfigKt.handleAlreadyClosed(Config.kt:20)
at io.legere.pdfiumandroid.PdfPage.close(PdfPage.kt:582)
at kotlin.io.CloseableKt.closeFinally(Closeable.kt:56)
at io.legere.pdfiumandroid.PdfiumCore.renderPageBitmap(PdfiumCore.kt:406)
at com.github.barteksc.pdfviewer.PdfFile.renderPageBitmap(PdfFile.java:301)
at com.github.barteksc.pdfviewer.RenderingHandler.proceed(RenderingHandler.java:109)
at com.github.barteksc.pdfviewer.RenderingHandler.handleMessage(RenderingHandler.java:66)
at android.os.Handler.dispatchMessage(Handler.java:117)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:293)
at android.os.HandlerThread.run(HandlerThread.java:110)
Environment:
Activity
jean-at-pc commentedon Nov 28, 2025
dup of #976 , #959 ?