Gradle sync failed: Could not HEAD ‘https://maven.aliyun.com/nexus/content/groups/public/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom’. Received status code 400 from server: Bad Request
解決方案:
- build.gradle添加阿里源 (兩個repositories內都添加)
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven{ url 'https://maven.aliyun.com/repository/google'}
maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven{ url 'https://maven.aliyun.com/repository/public'}
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
- 之前有按照其他人的方法設置了代理(比如別的大學的),需要把代理刪掉。
C://user/**/.gradle/gradle.properties文件中檢查有沒有VPN代理,有的話註釋掉