I've just installed android studio 2021.1.1 Patch 1 on my Linux system, when I launch it from Terminal it tries to download multiple files from https://dl.google.com but according to Terminal logs it shows these lines:
2022-02-21 11:09:26,527 [ 4079] WARN - s.RepoProgressIndicatorAdapter - Failed to download any source lists! 2022-02-21 11:09:27,088 [ 4640] WARN - s.RepoProgressIndicatorAdapter - IO exception while downloading manifest com.intellij.util.io.HttpRequests$HttpStatusException: Request failed with status code 404. Status=404, Url=https://dl.google.com/android/repository/repository2-2.xml at com.intellij.util.io.HttpRequests.throwHttpStatusError(HttpRequests.java:668) at com.intellij.util.io.HttpRequests.openConnection(HttpRequests.java:639) at com.intellij.util.io.HttpRequests$RequestImpl.getConnection(HttpRequests.java:356) at com.android.tools.idea.sdk.StudioDownloader.lambda$doDownloadFully$2(StudioDownloader.java:205) at com.intellij.util.io.HttpRequests.doProcess(HttpRequests.java:531) at com.intellij.util.io.HttpRequests.process(HttpRequests.java:513) at com.intellij.util.io.HttpRequests$RequestBuilderImpl.connect(HttpRequests.java:332) at com.android.tools.idea.sdk.StudioDownloader.doDownloadFully(StudioDownloader.java:201) at com.android.tools.idea.sdk.StudioDownloader.downloadFully(StudioDownloader.java:138) at com.android.tools.idea.sdk.StudioDownloader.downloadFully(StudioDownloader.java:259) at com.android.tools.idea.sdk.StudioDownloader.downloadAndStream(StudioDownloader.java:128) at com.android.repository.impl.manager.RemoteRepoLoaderImpl.lambda$fetchPackages$0(RemoteRepoLoaderImpl.java:138) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)
but if I open the url https://dl.google.com/android/repository/repository2-2.xml in browser it downloads successfully without a problem.
I also have these problems in idea.log file:
2022-02-21 11:09:24,379 [ 1931] INFO - s.RepoProgressIndicatorAdapter - Downloading https://dl.google.com/android/repository/addons_list-5.xml 2022-02-21 11:09:24,462 [ 2014] INFO - .imports.GMavenIndexRepository - Failed to refresh local disk cache: com.intellij.util.io.HttpRequests$HttpStatusException: Request failed with status code 404. Status=404, Url=https://dl.google.com/android/studio/gmaven/index/release/v0.1/classes-v0.1.json.gz 2022-02-21 11:09:24,462 [ 2014] INFO - .imports.GMavenIndexRepository - Scheduled to retry refreshing com.android.tools.idea.imports.GMavenIndexRepository after 2022-02-21 12:09:24. 2022-02-21 11:09:24,876 [ 2428] INFO - s.RepoProgressIndicatorAdapter - IOException: https://dl.google.com/android/repository/addons_list-5.xml 2022-02-21 11:09:24,877 [ 2429] INFO - s.RepoProgressIndicatorAdapter - com.intellij.util.io.HttpRequests$HttpStatusException: Request failed with status code 404. Status=404, Url=https://dl.google.com/android/repository/addons_list-5.xml
again I can access both https://dl.google.com/android/studio/gmaven/index/release/v0.1/classes-v0.1.json.gz and https://dl.google.com/android/repository/addons_list-5.xml from browser and download them successfully.
I don't have any firewall or proxy installed, the effect of these problems is that I can't install the android SDK at all, the SDK installer wizard shows "Nothing to do" but nothing is installed.
I've searched the problem and found people saying that android studio should be run as Administrator, I'm not using windows here, and using sudo is sure a wrong thing but I tried it anyway and it failed.
I'm also sure that the folder to which android studio is trying to install the SDK is writable because I'm trying to install the SDK in my home directory.
I've also found a video saying that changing region settings will fix the problem, the video was for Windows but I tried doing the same in Linux without success.
I remember once installing android studio 3.6 on my old laptop a long time ago and didn't encounter such issues, But now with bumblebee fresh installed on my new laptop, I see the problems above.
So how do I fix those problems?
Environment info:
OS: Arch Linux x64
JRE: I have both java-11-OpenJDK and java-17-OpenJDK and tried switching between them and the problems above still exist.
Android SDK Folder: /home/myuser/Android/Sdk
Android studio version: 2021.1.1 Patch 1 installed from archlinuxcn repo
Desktop Environment: KDE Plasma 5.24.1
Hardware specs(not sure if it's needed):
Processor: Intel i5-1135G7 11th generation
RAM: 8GB
DISK: SSD NVMe 256 GB hard disk but actual available space for the home directory is around 64GB
GPU: Nvidia GeForce MX350
Oh and I'm not using Wayland, just the good old X11.