Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ENOENT: no such file or directory, open 'android/app/src/main/assets/index.android.bundle'

When I run

npx react-native run-android --variant=release 

in RN 0.61.3 and I receive this error message.

ENOENT: no such file or directory, open 'android/app/src/main/assets/index.android.bundle'

The build works fine when debugging without the release variant.

like image 986
Matt Booth Avatar asked Nov 08 '19 13:11

Matt Booth


4 Answers

For some reason I needed to create the assets folder as per below.

android/app/src/main/assets

like image 141
Matt Booth Avatar answered Nov 20 '22 17:11

Matt Booth


  • Go to android/app/src/main/
  • Create one more folder of the name assets
    It will look like android/app/src/main/assets
  • Then run it. Absolutely workable.
like image 31
sherkhan Avatar answered Nov 20 '22 17:11

sherkhan


i had the assets folder already, but mistakenly had kept on being in the android folder, doing cd .. helped me and the run the command npx 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

like image 5
microsoftjulius Avatar answered Nov 20 '22 17:11

microsoftjulius


Right click the app folder New->Folder->Assests Folder

enter image description here

like image 4
RodneyO Avatar answered Nov 20 '22 15:11

RodneyO