I created a new project with react-native init . I am using react-native with the following:"react": "16.13.1","react-native": "0.63.2".
When i am trying to run the app with react-native run-android
command it shows build successful in the terminal but nothing appears in my metro bundler(I am attaching the image of it) and my emulator shows the 'Unable to load script' issue.
Unable to load script
If I press 'R' to reload the app in node(bundler) it says there is no device attached to it but my emulator is running. I encountered the same problem with personal device also. metro bundler not running
I also tried by creating the assets folder in android/app/src/main/assets
and run the below command:
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
.
With this only once the app gets displayed on the emulator and when I make changes in the App.js file and save it there is no change in the emulator.
If I reload the error "Could not connect to the development server" pops up. could not connect to development server Even tried the adb reverse and changing 'dev' options to local host and port 8081, but it was not useful. (If there is any specific path where I should try the above steps please mention).
What is that I have done wrong?
Can anyone help please.
P.S.: I am using a windows 10 machine.
Thank you.
Metro is a development platform for React Native. This project acts as a JavaScript bundler; it manages assets, caches builds and performs hot module reloading. Metro focuses on improving the developer experience for the React Native community.
"react-native": "0.64.1",
I used other solution but I've resolved this issue in other way.
I resolved it by changing bundleInDebug: true,
in project.ext.react
in android > app > build.gradle
.
project.ext.react = [
bundleInDebug: true,
enableHermes: ***,
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With