[Android] Bug: App Crashes on - java.lang.IllegalStateException: Already closed
What react-native version are you using?
0.74.5
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 :
- Steps to reproduce the issue or to explain in which case you get the issue
- Interesting
logs
Join a screenshot or video of the problem on the simulator or device?
Show us the code you are using?
<Modal
animationType="fade"
transparent={false}
visible
onRequestClose={onSyllubusViewRequestClose}
style={syllabusViewStyle.container}>
{syllabusLink && (
<Pdf
trustAllCerts={false}
source={{
uri: syllabusLink,
cache: true,
cacheFileName: syllabusLink.split("/")[syllabusLink.split("/").length - 1],
}}
onLoadComplete={onLoadComplete}
onError={onPDFError}
style={{
flex: 1,
marginTop: 50,
width: Dimensions.get("window").width,
height: Dimensions.get("window").height - 50,
}}
/>
)}
</Modal>
Iam using ExpoSDK 51 this happens when immediately closing the pdf before its loaded while testing,
Is there any solution for this, i though this gets fixed in last version!
Same issue
Same issue
Same issue
@wonday Any ideas?
Seems the same as: https://github.com/wonday/react-native-pdf/issues/830
Also seems mentioned in latest version: https://github.com/wonday/react-native-pdf/pull/840
same issue "react-native-pdf": "6.7.5", any solution?. let me know here
any news? same issue here
Issue still persists for version 6.7.6
Same issue.
Using react-native: 0.73.11 react-native-pdf: 6.7.6
Same issue.
"@config-plugins/react-native-pdf": "9.0.0", "react-native-pdf": "^6.7.7", "react-native": "0.77.0",
Same issue.
"@config-plugins/react-native-pdf": "9.0.0", "react-native-pdf": "^6.7.7", "react-native": "0.77.0",
+1
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.
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
@suresh-mojro Try to apply patch from here: https://github.com/wonday/react-native-pdf/issues/830#issuecomment-2641958482
@suresh-mojro Try to apply patch from here: #830 (comment)
it was not working if I use url, it works only if i use cache file location
@suresh-mojro I am also using URL and cache disabled, in my case react-native version is "0.77.2" .
@suresh-mojro I am also using URL and cache disabled, in my case
react-nativeversion 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.
The patch of @suresh-mojro solved the problem for me
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.