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 771 forks source link

null is not an object (evaluating 'RNFetchBlob.DocumentDir') #422

Closed fanzhiri closed 2 years ago

fanzhiri commented 4 years ago

We're having a similar issue after upgrading to React Native 0.60 and using auto linking.

Screenshot_20190801-112619_Yeppik

Originally posted by @EgidioCaprino in https://github.com/joltup/rn-fetch-blob/issues/244#issuecomment-517205908

zabojad commented 2 years ago

I switched to https://github.com/RonRadtke/react-native-blob-util

MarquisAlexander commented 2 years ago

this happened to me on android, i run a react-native run-android and the problem stopped happening

trandinhhiep789 commented 2 years ago

and now it's stuck in ios versions, any solution for Ios?

stoplion commented 2 years ago

Stuck on the same problem.

fukemy commented 2 years ago

pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'

then i got this error:

error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually: 
  - rn-fetch-blob (to unlink run: "react-native unlink rn-fetch-blob")
  - ....

Then npm run ios throw error with 100000000+ lines of info

INnoVatioN-97 commented 1 year ago

Hi guys: the only fix I have found for this issue is to use the good old manual linking.

In MainApplication.java add:

...
import com.RNFetchBlob.RNFetchBlobPackage;
...

    protected List<ReactPackage> getPackages() {
        // Add additional packages you require here
        // No need to add RnnPackage and MainReactPackage
        return Arrays.<ReactPackage>asList(
                 ...
                new RNFetchBlobPackage(), <- add this
        );
    }

I think It doesn't work for me... is here anybody solved this problem??

harismalik-351 commented 1 year ago

i have the same issue in android can you explain it for android

harismalik-351 commented 1 year ago

ERROR TypeError: Cannot read property 'DocumentDir' of null, js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes

im facing this in android

polsust commented 1 year ago

ERROR TypeError: Cannot read property 'DocumentDir' of null, js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes

im facing this in android

I'm getting this same error, only on real hardware (not on an emulator)

harismalik-351 commented 1 year ago

First delete the node_module folder rm -rf node_module/ then npm install After that go to androd folder and ./gradlew clean then npx react-native run-android

On Mon, Dec 12, 2022, 7:02 PM Pol Sust @.***> wrote:

ERROR TypeError: Cannot read property 'DocumentDir' of null, js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes

im facing this in android

I'm getting this same error, only on real hardware (not on an emulator)

— Reply to this email directly, view it on GitHub https://github.com/joltup/rn-fetch-blob/issues/422#issuecomment-1346562344, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT25EBFH4KOUYQHYM56KJKTWM4V53ANCNFSM4IMFXPJQ . You are receiving this because you commented.Message ID: @.***>

polsust commented 1 year ago

B

First delete the node_module folder rm -rf node_module/ then npm install After that go to androd folder and ./gradlew clean then npx react-native run-android On Mon, Dec 12, 2022, 7:02 PM Pol Sust @.> wrote: ERROR TypeError: Cannot read property 'DocumentDir' of null, js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes im facing this in android I'm getting this same error, only on real hardware (not on an emulator) — Reply to this email directly, view it on GitHub <#422 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT25EBFH4KOUYQHYM56KJKTWM4V53ANCNFSM4IMFXPJQ . You are receiving this because you commented.Message ID: @.>

But It already worked on the emulator, however it's still not working on real hardware

harismalik-351 commented 1 year ago

npm install --save github:joltup/rn-fetch-blob after this clean the gradlew file and build your app

On Mon, Dec 12, 2022 at 7:46 PM Pol Sust @.***> wrote:

B

First delete the node_module folder rm -rf node_module/ then npm install After that go to androd folder and ./gradlew clean then npx react-native run-android … <#m8164617126827263686> On Mon, Dec 12, 2022, 7:02 PM Pol Sust @.> wrote: ERROR TypeError: Cannot read property 'DocumentDir' of null, js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes im facing this in android I'm getting this same error, only on real hardware (not on an emulator) — Reply to this email directly, view it on GitHub <#422 (comment) https://github.com/joltup/rn-fetch-blob/issues/422#issuecomment-1346562344>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT25EBFH4KOUYQHYM56KJKTWM4V53ANCNFSM4IMFXPJQ https://github.com/notifications/unsubscribe-auth/AT25EBFH4KOUYQHYM56KJKTWM4V53ANCNFSM4IMFXPJQ . You are receiving this because you commented.Message ID: @.>

But It already worked on the emulator, however it's still not working on real hardware

— Reply to this email directly, view it on GitHub https://github.com/joltup/rn-fetch-blob/issues/422#issuecomment-1346632110, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT25EBDXCJA6YIIN7NTJD43WM43DVANCNFSM4IMFXPJQ . You are receiving this because you commented.Message ID: @.***>

vikram-segta commented 1 year ago

I also have same issue after 'npm install rn-fetch-blob --save' in android react-native - 0.64.3 --version

1.) cd android Navigate to android directory from the root directory of your React Native project.

2.) ./gradlew clean
This command will delete all the temporary files and build artifacts generated during the previous build

3.) ./gradlew assembleDebug This command will build your application and generate the APK file that you can use to install on your Android device

This is work for me 😃