'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.



Solution 1:[1]

  • 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.

Solution 2:[2]

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

enter image description here

Solution 3:[3]

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

Solution 4:[4]

You can use this command:

npx mkdirp 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/

Solution 5:[5]

You should use this command to create assets folder in android.

Run this command in project directory.

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

Please use this, Its help me.

Solution 6:[6]

We can use this command?npx mkdirp 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/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 greybeard
Solution 2 RodneyO
Solution 3 microsoftjulius
Solution 4 Elikill58
Solution 5 Mayank Garg
Solution 6 youngjuning