Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react native bundle sha-1 for file not computed(unable to load script from assets index.android.bundle)

Tags:

react-native

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"
like image 687
Mehrdad Mohammadi Avatar asked Aug 13 '18 16:08

Mehrdad Mohammadi


3 Answers

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

npm i -g react-native-cli
like image 94
Yairopro Avatar answered Nov 08 '22 02:11

Yairopro


Ran into the same issue when using the react-native to run the mentioned command directly.

Running the same command with npx solved it for me. Try running the below and see if that helps.

npx 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
like image 11
Ashutosh Upadhyay Avatar answered Nov 08 '22 02:11

Ashutosh Upadhyay


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

like image 9
Evan Norton Avatar answered Nov 08 '22 02:11

Evan Norton