0

I was installing Android Studio on my Ubuntu 16.04.4 LTS. I successfully downloaded it and I can run with ./studio.sh from /opt/android-studio/bin. After executing this command, it starts downloading some components but after some time, its fails and gives the following log:

Android SDK Build-Tools 27.0.3 and 3 more SDK components were not installed

java.io.IOException: Cannot download 
'https://dl.google.com/android/repository/
android_m2repository_r47.zip': 
Read timed out
, response: 200 OK

Warning: An error occurred while preparing SDK 
package Android Support Repository: Cannot 
download 'https://dl.google.com/android/repository/
android_m2repository_r47.zip': 
Read timed out
, response: 200 OK.

java.io.IOException: Cannot download 
'https://dl.google.com/android/repository/
build-tools_r27.0.3-linux.zip': 
Read timed out
, response: 200 OK

Warning: An error occurred while preparing SDK 
package Android SDK Build-Tools 27.0.3: Cannot 
download 'https://dl.google.com/android/repository/
build-tools_r27.0.3-linux.zip': 
Read timed out
, response: 200 OK.

java.io.IOException: Cannot download 
'https://dl.google.com/android/repository/
google_m2repository_gms_v11_3_rc05_wear_2_0_5.zip': 
Read timed out
, response: 200 OK

Warning: An error occurred while preparing SDK 
package Google Repository: Cannot download 
'https://dl.google.com/android/repository/
google_m2repository_gms_v11_3_rc05_wear_2_0_5.zip': 
Read timed out
, response: 200 OK.

java.io.IOException: Cannot download 
'https://dl.google.com/android/repository/
sources-27_r01.zip': 
Read timed out
, response: 200 OK

Warning: An error occurred while preparing SDK 
package Sources for Android 27: Cannot download 
'https://dl.google.com/android/repository/
sources-27_r01.zip': 
Read timed out
, response: 200 OK.

java.io.IOException: Cannot download 
'https://dl.google.com/android/repository/
platform-27_r01.zip': 
Read timed out
, response: 200 OK

Warning: An error occurred while preparing SDK 
package Android SDK Platform 27: Cannot download 
'https://dl.google.com/android/repository/
platform-27_r01.zip': 
Read timed out
, response: 200 OK.

So what's the solution?

Even if I download these .zip files externally, what are their respective locations where I can extract them to make the studio working?

MrEyebr0w5
  • 5
  • 1
  • 3
  • Do you have write permission into that /opt/... area? You could install in your home directory and avoid such problems. – ubfan1 Apr 03 '18 at 15:38
  • Yes. I have the permission. But these are SDK components. They will be placed in `~/Android/Sdk` folder which is the `Home` directory right? – MrEyebr0w5 Apr 03 '18 at 15:56
  • `/opt` is where the android studio files are residesiding and `~/Android/Sdk` is the location of the Android SDK files – MrEyebr0w5 Apr 03 '18 at 16:26
  • What version android studio are you running, and did you upgrade from an earlier one? Click on the "configure" button from main page, then SDK Manager, and the SDK Path will be shown at the top, where it may be changed to whatever you want. – ubfan1 Apr 03 '18 at 19:49
  • I have the latest version of AS from the android studio website. And I didn't upgraded from previous version. Its a fresh install. When I open the SDK manager, the SDK path text-box appears blank. It gives error at the bottom of text-box "The SDK path is not been specified". I clicking on edit and it takes me to SDK setup wizard saying that "Some SDK components are missing and they needs to be downloaded". If I click next, the same download process starts. The sdk path is `~/Android/Sdk` – MrEyebr0w5 Apr 04 '18 at 14:22
  • Another user has the similar problem but its not been answered my anyone. Link: https://askubuntu.com/questions/949918/cannot-download-and-update-some-android-sdk-components – MrEyebr0w5 Apr 04 '18 at 14:37
  • First I thought its the problem with the AS. Therefore I tried installing `Eclipse`. When I was installing Android Plug-in on Eclipse, during the `SDK` download, it was failing after some times like AS. I think there is some problem with the server. – MrEyebr0w5 Apr 04 '18 at 14:47
  • I upgraded from AS 2.0 to 3.1 last night without problem. I did not import any AS 2.0 settings, which had an SDk Path I did not want. Same URLs as in your post for the download worked for me. Maybe use /home/username instead of the "~" – ubfan1 Apr 04 '18 at 14:59
  • I tried downloading from another Internet connection but problem remains the same. Shall I reinstall Ubuntu and everything and try again? Or if I download those files manually, can you tell me what are their paths in SDK folder at which I should copy them? – MrEyebr0w5 Apr 04 '18 at 16:53
  • I doubt a reinstallation of Ubuntu is necessary. I just downloaded the as zip file, unpacked it in a writeable directory, ran the Wizard and did not import anything, and noted the default of /home/username/Android/Sdk was not what I wanted, so moved it to another writeable location. I did have JAVA_HOME defined to locate my jdk. Nothing special really. – ubfan1 Apr 04 '18 at 21:20

0 Answers0