2

enter image description here

First When I created the app with react-native init project1 . I was getting an error as below

Unable to load script from assets index.android.bundle on windows

Later I solved this issue by running following commands Stackoverflow link

mkdir android/app/src/main/assets

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

react-native run-android

But later I am getting an error like this and not able to solve, Module HMRClient is not a registered callable module (calling enable)

Anand S
  • 790
  • 1
  • 7
  • 22

4 Answers4

6

This is the common occurred problem, but there will not be some problem in bundling the app, Just follow some common steps and it worked for me. Delete node_module folder and install npm

rm -rf node_modules && npm install

cd android && ./gradlew clean

then cd .. && react-native run-android

Kiran Ghatage
  • 407
  • 1
  • 8
  • 15
  • 1
    I was Deleting Node Modules and Trying to run but still getting the same error, after running cd android && ./gradlew clean Now Its solved. Thank you, – Anand S Nov 09 '18 at 06:26
  • not working for me on real android device. It shows "Hot loading" at the bottom during a change, but nothing updates. RN 0.60.4 here. – msqar Aug 01 '19 at 12:59
  • 1
    And also we need to disable hot reloading and of course when we clean build it hot reload will be disabled. but unfortunately not in iOS – Anand S Jan 09 '20 at 06:36
3

If you're developing a native module and your npm link'd folder contains a node_modules directory, this can also produce the error.

To correct for this case, you can delete the node_modules directory, re-install your project in the linked folder and use react-native start --reset-cache.

Mapsy
  • 4,192
  • 1
  • 37
  • 43
2

Disable hot reloading, it will work fine

  • 2
    It's literally super hard to code an app WITHOUT hot reloading. That shouldn't be a possible fix in anyone's mind. – msqar Aug 01 '19 at 12:53
  • This is one of the correct truth that hot reloading has to be disabled. it worked after clean build. – Anand S Jan 09 '20 at 06:36
1

This issue occurs if we enabled the production mode from dev setting by unchecking "JS Dev Mode" and then try to enable the hot reload. Enable JS Dev Mode again will work.

Waheed Akhtar
  • 3,110
  • 1
  • 16
  • 30