22

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.

Matt Booth
  • 1,033
  • 1
  • 8
  • 16

7 Answers7

64

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

android/app/src/main/assets

Matt Booth
  • 1,033
  • 1
  • 8
  • 16
6
  • 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.
greybeard
  • 2,102
  • 7
  • 24
  • 58
sherkhan
  • 453
  • 4
  • 6
3

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

enter image description here

RodneyO
  • 105
  • 7
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

1

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/
Elikill58
  • 3,190
  • 22
  • 17
  • 38
ViShU
  • 72
  • 5
0

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.

Mayank Garg
  • 1,186
  • 1
  • 9
  • 22
0

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/