joltup / rn-fetch-blob

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

f.DocumentDir null when version delivered via codepush #519

Closed enigmablue closed 4 years ago

enigmablue commented 4 years ago

Hello

I'm having f.DocumentDir null issue with launching my app (on android) that has been bundled as part of a codepush package.

Background: Basically, users have older versions that are on their mobile phones that do NOT have rn-fetch-blob. I use codepush to deliver remote binaries to them.

Problem: The app is able to load locally without any issues at all. But when delivered through a remote location, the same app (binary) that is loaded crashes with "null is not an object (evaluating 'f.DocumentDir')"

This is the error i get for android. Its worse for IOS, just crashes when loading the bundle. no errors :/

What i am doing with my code: Just import RNFetchBlob from 'rn-fetch-blob';

What i have tried: manual linking (settings.gradle, build.gradle implementation). But main application dosen't let me add anything because i have auto linking on.

I'm curious how the DocumentDir is derived? Any help is welcome! Thanks!

React Native version: 61.2

Here's the stack trace:

2020-01-13.00-52-42.debug.log.txt

Traviskn commented 4 years ago

You cannot code push native code changes, rn-fetch-blob requires native code to run

enigmablue commented 4 years ago

You cannot code push native code changes, rn-fetch-blob requires native code to run

Sorry so that means that fetchblob (or even fs) can never be codepushed? And user will have to get through the store?

Traviskn commented 4 years ago

It means you cannot code push the native code that fetch blob depends on. This applies to any native library. You can only push JavaScript. Once your users have a version of the app from the store that already includes the native code for fetch blob, then you can code push JS only changes that update fetch blob related code

enigmablue commented 4 years ago

It means you cannot code push the native code that fetch blob depends on. This applies to any native library. You can only push JavaScript. Once your users have a version of the app from the store that already includes the native code for fetch blob, then you can code push JS only changes that update fetch blob related code

Understood. Thank you so much for explaining