2

I can't start the android emulator on vs code to run react-native. I already have an emulator in android studio. It shows

error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`. As a fresher to react-native, I don't know what to do. Metro bundler is running well, But When enter npx react-native run-android

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 870 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
Starting a Gradle Daemon (subsequent builds will be faster)
IOException: https://dl.google.com/android/repository/addons_list-3.xml
java.net.ConnectException: Connection refused: connect
IOException: https://dl.google.com/android/repository/addons_list-2.xml
java.net.ConnectException: Connection refused: connect
IOException: https://dl.google.com/android/repository/addons_list-1.xml
java.net.ConnectException: Connection refused: connect
Failed to download any source lists!
IO exception while downloading manifest:
java.net.ConnectException: Connection refused: connect
Arjun_B
  • 41
  • 7
  • Could you please explain to us what step you've done so far? please look at this documentation https://reactnative.dev/docs/running-on-device. And make sure your metro bundler is running on your terminal otherwise, hit `react-native start` – Marfin. F Nov 06 '21 at 06:32
  • I just created the project and trying to run it.Metro Bundler also showing the error `Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported` – Arjun_B Nov 06 '21 at 11:45
  • Did you try this? https://stackoverflow.com/questions/69692842/error0308010cdigital-envelope-routinesunsupported – Marfin. F Nov 06 '21 at 12:41
  • with that link, I solved the error in the metro bundler. So Metro bundler is running well. And the problem remaining is the emulator is not running... – Arjun_B Nov 06 '21 at 17:21
  • The error while running `react-native run-android` is that `error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds.` – Arjun_B Nov 06 '21 at 17:41
  • You have to run your emulator first on android studio before running `yarn android` – Marfin. F Nov 06 '21 at 23:31
  • I tried it but the output is the same error – Arjun_B Nov 07 '21 at 13:20
  • Did you try to setup local properties on android? https://stackoverflow.com/questions/27620262/sdk-location-not-found-define-location-with-sdk-dir-in-the-local-properties-fil? if yes, please try hit `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` – Marfin. F Nov 07 '21 at 17:14
  • Hey, metro bundler is running well but can't start the emulator. when entering `npx react-native run-android` shows `java.net.ConnectException: Connection refused: connect` – Arjun_B Nov 10 '21 at 09:46

1 Answers1

1

Problem solved.
1 :Downgraded the node js
2 :Changed the buildToolsVersion and it work

Arjun_B
  • 41
  • 7