How to fix java.net.NoRouteToHostException in Android Studio


If you run into the below error "java.net.NoRouteToHostException" while installing Android Studio SDK packages, it could be due to the following reasons,

  1. You lost your internet connectivity. Check your System's internet connectivity (easiest way is to open your web browser and see if you can access the web)
  2. If Step 1 does not work check any of the download links that failed works on your browser https://dl.google.com/android/
  3. 3. Check your proxy settings.
Sample Error Stack:
Intel x86 Emulator Accelerator (HAXM installer), 
Android Emulator and 6 more SDK components were 
not installed

java.net.NoRouteToHostException: No route to host: 
connect
Warning: An error occurred while preparing SDK 
package Intel x86 Emulator Accelerator (HAXM 
installer): No route to host: connect.

Warning: An error occurred while preparing SDK 
package Intel x86 Emulator Accelerator (HAXM 
installer): No route to host: connect.

Warning: An error occurred while preparing SDK 
package SDK Patch Applier v4: No route to host: 
connect.

Warning: An error occurred while preparing SDK 
package Google APIs Intel x86 Atom System Image: 
No route to host: connect.

Warning: An error occurred while preparing SDK 
package Android SDK Platform 29: No route to host: 
connect.

Warning: An error occurred while preparing SDK 
package Android SDK Build-Tools 29.0.3: No route 
to host: connect.

Warning: An error occurred while preparing SDK 
package Sources for Android 29: No route to host: 
connect.
Preparing "Install Android SDK Platform-Tools (revision: 30.0.1)".
Downloading https://dl.google.com/android/repository/platform-tools_r30.0.1-windows.zip
"Install Android SDK Platform-Tools (revision: 30.0.1)" ready.

Installing Android SDK Platform-Tools in C:\Users\c2c\AppData\Local\Android\Sdk\platform-tools
"Install Android SDK Platform-Tools (revision: 30.0.1)" complete.
"Install Android SDK Platform-Tools (revision: 30.0.1)" finished.

Preparing "Install Intel x86 Emulator Accelerator (HAXM installer) (revision: 7.5.6)".
Downloading https://dl.google.com/android/repository/extras/intel/haxm-windows_v7_5_6.zip
java.net.NoRouteToHostException: No route to host: connect
Warning: An error occurred while preparing SDK package Intel x86 Emulator Accelerator (HAXM installer): No route to host: connect.

"Install Intel x86 Emulator Accelerator (HAXM installer) (revision: 7.5.6)" failed.
Preparing "Install Android Emulator (revision: 30.0.12)".

Downloading https://dl.google.com/android/repository/emulator-windows-6466327.zip
java.net.NoRouteToHostException: No route to host: connect
Warning: An error occurred while preparing SDK package Android Emulator: No route to host: connect.
"Install Android Emulator (revision: 30.0.12)" failed.

Preparing "Install SDK Patch Applier v4 (revision: 1)".
Downloading https://dl.google.com/android/repository/3534162-studio.sdk-patcher.zip
java.net.NoRouteToHostException: No route to host: connect
Warning: An error occurred while preparing SDK package SDK Patch Applier v4: No route to host: connect.
"Install SDK Patch Applier v4 (revision: 1)" failed.

Preparing "Install Android SDK Tools (revision: 26.1.1)".
Downloading https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip
java.net.NoRouteToHostException: No route to host: connect
Warning: An error occurred while preparing SDK package Android SDK Tools: No route to host: connect.
"Install Android SDK Tools (revision: 26.1.1)" failed.

Preparing "Install Google APIs Intel x86 Atom System Image (revision: 10)".
Downloading https://dl.google.com/android/repository/sys-img/google_apis/x86-29_r10.zip
java.net.NoRouteToHostException: No route to host: connect
Warning: An error occurred while preparing SDK package Google APIs Intel x86 Atom System Image: No route to host: connect.

"Install Google APIs Intel x86 Atom System Image (revision: 10)" failed.
Preparing "Install Android SDK Platform 29 (revision: 4)".

Downloading https://dl.google.com/android/repository/platform-29_r04.zip
java.net.NoRouteToHostException: No route to host: connect
Warning: An error occurred while preparing SDK package Android SDK Platform 29: No route to host: connect.
"Install Android SDK Platform 29 (revision: 4)" failed.

Preparing "Install Android SDK Build-Tools 29.0.3 (revision: 29.0.3)".
Downloading https://dl.google.com/android/repository/build-tools_r29.0.3-windows.zip
java.net.NoRouteToHostException: No route to host: connect
Warning: An error occurred while preparing SDK package Android SDK Build-Tools 29.0.3: No route to host: connect.

"Install Android SDK Build-Tools 29.0.3 (revision: 29.0.3)" failed.
Preparing "Install Sources for Android 29 (revision: 1)".

Downloading https://dl.google.com/android/repository/sources-29_r01.zip
java.net.NoRouteToHostException: No route to host: connect
Warning: An error occurred while preparing SDK package Sources for Android 29: No route to host: connect.
"Install Sources for Android 29 (revision: 1)" failed.

Parsing C:\Users\c2c\AppData\Local\Android\Sdk\platform-tools\package.xml
java.net.NoRouteToHostException: No route to host: connect


















Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap