I have the latest Android Studio IDE installed on my Windows 10 laptop, and it was working fine until my windows operating system made a huge automatic update.
Now,
I just removed
include ':app'
from setting.gradle
and then sync project
it will fails again
then write it back an re-sync and then error gone and will start downloading.
For Chinese users who often use a proxy to download dependency jars, the cause is often proxy settings.
We should check multiple places if the proxy is correctly configured.
In my case, I somehow once configured an HTTP proxy in ~/.gradle/gradle.properties
, which was forgotten later. Then when I dealt with a SOCKS5 proxy in IDE Settings and project-level gradle.properties
, things always run into trouble. Finally, deleting invalid proxy settings in ~/.gradle/gradle.properties
save my day.
Use the following code in gradle.properties :
systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
org.gradle.daemon=false
None of the answer worked for me.
I solved it by
I encounter this error "Read Time Out", and I simply choose menu item: File -> Invalidate Caches / Restart... to fixed it.
[UPDATE]
I just encounter this error for second time, this time Invalidate Caches / Restart... not able to fix it, but then I try close the android Studio, killall -9 java
to ensure all java process has been terminated, then relaunch Android Studio, no more error.
[UPDATE 2] I just encounter this error and I fixed it by replug the phone cable and rerun.
Editing global gradle.properties
with the following line was the fix for me:
org.gradle.jvmargs=-Dorg.gradle.internal.http.connectionTimeout=120000 -Dorg.gradle.internal.http.socketTimeout=120000