wkh237 / react-native-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.61k stars 1.59k forks source link

'java.io.File java.io.File.getParentFile()' error in android #608

Open nes123 opened 6 years ago

nes123 commented 6 years ago

Exception com.facebook.react.common.JavascriptException: Java exception in 'NativeModules' java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File java.io.File.getParentFile()' on a null object reference, stack: com.RNFetchBlob.RNFetchBlobFS.getSystemfolders

any ideas what can it be ?

jslok commented 6 years ago

Same issue here, but only seen on one device so far on android 6.0.1. RN 0.49.3 and RN fetch blob 0.10.8

gbdxl commented 6 years ago

+1

chrusart commented 6 years ago

https://github.com/wkh237/react-native-fetch-blob/pull/557

manishoo commented 6 years ago

I have the same issue

juanamd commented 6 years ago

Same issue here

mannol commented 6 years ago

Same issue. Happens a lot on many different devices. Here's a stack trace:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File java.io.File.getParentFile()' on a null object reference, stack:
com.RNFetchBlob.RNFetchBlobFS.getSystemfolders@216
com.RNFetchBlob.RNFetchBlob.getConstants@84
com.facebook.react.bridge.JavaModuleWrapper.getConstants@140
android.os.Handler.handleCallback@815
android.os.Handler.dispatchMessage@104
com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage@31
josenaves commented 6 years ago

+1

saubcy commented 6 years ago

+1

josenaves commented 6 years ago

@mannol which devices it happens ? For me, I saw it on a LGV520.

mannol commented 6 years ago

@josenaves Well, I see it happening on at least 10 devices in production. What's interesting is that crashlytics reports that the crash happens when app is about 81% in focus, which could mean that the crash happens when the activity is being destroyed... Race condition while accessing the context maybe?

kelset commented 6 years ago

It looks like @chrusart created a PR with the fix 🎉

https://github.com/wkh237/react-native-fetch-blob/pull/619#issuecomment-357925638

chrusart commented 6 years ago

@kelset #636 have this fix too and few other improvements and bugfixes, in production for 3 weeks now and fixed crashes didn't occur yet, no new ones appeared.

ZionChang commented 6 years ago

+1

SuhairZain commented 6 years ago

@chrusart It seems like this repo is no longer maintained. Could you open a PR there? https://github.com/wkh237/react-native-fetch-blob/pull/636#issuecomment-375953433