I created react-native init project
then I run the project using react-native run-android it will run without any issues.
When i try to build apk using below comment
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
I m facing this error
error ENOENT: no such file or directory, open 'android\app\src\main\assets\index.android.bundle'. Run CLI with --verbose flag for more details. Error: ENOENT: no such file or directory, open 'android\app\src\main\asset\index.android.bundle'
You can achieve this by first navigating to : 'android\app\src\main
folder in your app and there create a folder named assets
, so hence while bundling react native will create the index.android.bundle
in android\app\src\main\assets
folder.
Hope it helps