20
votes

I'm using react-native getting started tutorial for creating new rn app.after installations when I try to run my just created app I'm getting this error:

unable to load script from assets index.android.bundle

after lot's of research about this lead me to do bundle but when I do bundle with this command

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

I'm getting this error:

SHA-1 for file c:\Users\mehrdad\Desktop\WorkSpace\ReactNative\awesomeproject\index.js is not computed

And my problem still exists

"react": "16.4.1",

"react-native": "0.56.0",

"windows 8.1"
7

7 Answers

41
votes

I updated react-native-cli and the problem disappeared :

npm i -g react-native-cli
8
votes

My issue was that I tried to require a file with the proper path but incorrect capitalization.

5
votes

If the error also includes metro-bundler not working, try restart your system. I restarted my system and it worked for me.

5
votes

Again start metro bundle i.e react-native start and then working

3
votes

Just terminate your current Metro bundler process and start a new Metro bundler. Worked for me!!

3
votes

For me, I was using react-native start when I normally use npx react-native start, using npx fixed the issue!

1
votes
npm i -g react-native-cli

update your react native CLI globally. enter image description here