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
[Android] Bug: App Crashes on - java.lang.IllegalStateException: Already closed #882
changed the title [-][Android] Bug: java.lang.IllegalStateException: Already closed[/-][+][Android] Bug: App Crashes on - java.lang.IllegalStateException: Already closed[/+]on Nov 8, 2024
same issue "react-native-pdf": "6.7.5", any solution?. let me know here
Fatal Exception: java.lang.IllegalStateException: Already closed
at io.legere.pdfiumandroid.util.ConfigKt.handleAlreadyClosed(Config.kt:20)
at io.legere.pdfiumandroid.PdfPage.renderPageBitmap(PdfPage.kt:358)
at io.legere.pdfiumandroid.PdfPage.renderPageBitmap$default(PdfPage.kt:349)
at io.legere.pdfiumandroid.PdfiumCore.renderPageBitmap(PdfiumCore.kt:407)
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:106)
at android.os.Looper.loopOnce(Looper.java:257)
at android.os.Looper.loop(Looper.java:368)
at android.os.HandlerThread.run(HandlerThread.java:67)
Unfortunately, if I downgrade to 6.7.2, I cannot open iOS links. I applied a patch to open links on 6.7.6. But I am having an Android crash problem with 6.7.6.
@suresh-mojro I am also using URL and cache disabled, in my case react-native version is "0.77.2" .
from react-native-pdf version 6.7.4 onwards they have changed android native dependency for pdf rendering, so i think that was causing the issue, so i have made the changes and created patch for my usability in the latest version it self, this patch will work for both IOS and Android.
This is a very long patch, I don't want to add these much changes. Can you please suggest the bare minimum changes needed to fix this out of all the changes done.
This is a very long patch, I don't want to add these much changes. Can you please suggest the bare minimum changes needed to fix this out of all the changes done.
No i don't have ant other solution as of now, that has to come from their team, since it was causing due to native dependencies in android, we have to wait till the next upgrade.
This is a very long patch, I don't want to add these much changes. Can you please suggest the bare minimum changes needed to fix this out of all the changes done.
No i don't have ant other solution as of now, that has to come from their team, since it was causing due to native dependencies in android, we have to wait till the next upgrade.
Activity
[-][Android] Bug: java.lang.IllegalStateException: Already closed[/-][+][Android] Bug: App Crashes on - java.lang.IllegalStateException: Already closed[/+]NJneeraj commentedon Nov 9, 2024
Same issue
keung7252 commentedon Nov 14, 2024
Same issue
BerkeAras-SMM commentedon Dec 4, 2024
Same issue
BerkeAras-SMM commentedon Dec 4, 2024
@wonday Any ideas?
vladimirivanoviliev commentedon Dec 5, 2024
Seems the same as: #830
vladimirivanoviliev commentedon Dec 5, 2024
Also seems mentioned in latest version: #840
Mallikarjuna-s commentedon Dec 12, 2024
same issue "react-native-pdf": "6.7.5", any solution?. let me know here
bjutkoski commentedon Dec 27, 2024
any news? same issue here
EwaGuziejko commentedon Jan 27, 2025
Issue still persists for version 6.7.6
Shasikhan commentedon Jan 29, 2025
Same issue.
Using
react-native: 0.73.11
react-native-pdf: 6.7.6
augusthjerrild commentedon Feb 21, 2025
Same issue.
"@config-plugins/react-native-pdf": "9.0.0",
"react-native-pdf": "^6.7.7",
"react-native": "0.77.0",
husnaintahir commentedon Mar 22, 2025
+1
gonca-gul commentedon May 7, 2025
Unfortunately, if I downgrade to 6.7.2, I cannot open iOS links. I applied a patch to open links on 6.7.6. But I am having an Android crash problem with 6.7.6.
suresh-mojro commentedon May 21, 2025
I am facing the same issue on android
"react-native": "^0.79.1",
"react-native-pdf": "^6.7.7",
if some one have any solutions please help here
Shasikhan commentedon May 21, 2025
@suresh-mojro Try to apply patch from here: #830 (comment)
suresh-mojro commentedon May 21, 2025
it was not working if I use url, it works only if i use cache file location
Shasikhan commentedon May 21, 2025
@suresh-mojro I am also using URL and cache disabled, in my case
react-nativeversion is"0.77.2".suresh-mojro commentedon May 23, 2025
from react-native-pdf version 6.7.4 onwards they have changed android native dependency for pdf rendering, so i think that was causing the issue, so i have made the changes and created patch for my usability in the latest version it self, this patch will work for both IOS and Android.
react-native-pdf+6.7.7.patch
SamiChab commentedon May 28, 2025
The patch of @suresh-mojro solved the problem for me
jakhil232 commentedon Jul 24, 2025
This is a very long patch, I don't want to add these much changes. Can you please suggest the bare minimum changes needed to fix this out of all the changes done.
suresh-mojro commentedon Jul 24, 2025
No i don't have ant other solution as of now, that has to come from their team, since it was causing due to native dependencies in android, we have to wait till the next upgrade.
adarshlatiyan commentedon Jul 28, 2025
The patch doesn't support 16kb page size.
@suresh-mojro This solution isn't compatible with 16kb page size.
The following PR aims at resolving the same.
zacharee/AndroidPdfViewer#1
Natanaelvich commentedon Dec 10, 2025
I migrated the PDF viewing implementation to https://github.com/126punith/react-native-pdf-jsi, and since then I have not encountered this crash anymore. It seems the issue is resolved with this library.
eduardolbruno commentedon Dec 12, 2025
This library isn't compatible with Expo yet. Sharing for anyone interested in using it.
iliascandis commentedon Dec 17, 2025
The following patch addressed the issue while having 16 kb page size compatibility
react-native-pdf-npm-7.0.3-6313469aca.patch