Skip to content

Android: App crashes when getExternalFilesDir() returns null #61

Closed
@poison

Description

@poison

Hi,

I noticed that sometimes getExternalFilesDir() returns null, and then the app crashes.

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@216 com.RNFetchBlob.RNFetchBlob.getConstants@84 com.facebook.react.bridge.JavaModuleWrapper.getConstants@140 android.os.Handler.handleCallback@751 android.os.Handler.dispatchMessage@95 com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage@31

I can reproduce it when I'm on Android 4.3 or below, but in production (we have an app with +/- 1 million installs) we hit this error on all kind of Android versions.

Best,
Nicolas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions