Android 各种报错解决

报错:

Caused by: org.gradle.api.resources.ResourceException: Unable to load Maven meta-data from https://maven.google.com/com/android/support/support-v4/maven-metadata.xml.

Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD 'https://maven.google.com/com/android/support/support-v4/maven-metadata.xml'.

Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to maven.google.com:443 [maven.google.com/216.58.200.14] failed: Read timed out

Caused by: java.net.SocketTimeoutException: Read timed out

原因:google 自家的 maven 仓库 http://maven.google.com 无法访问 或者 https://maven.google.com连接不上

解决:在build.gradle里替换成maven { url 'https://dl.google.com/dl/android/maven2/' } 就OK了

你可能感兴趣的:(Android 各种报错解决)