Received status code 400 from server: Bad Request

- 日理万妓 2023-10-09 22:47 139阅读 0赞

一、报错信息

  1. FAILURE: Build failed with an exception.
  2. * What went wrong:
  3. A problem occurred configuring root project 'lianliankan'.
  4. > Could not resolve all artifacts for configuration ':classpath'.
  5. > Could not resolve com.android.tools.build:gradle:3.6.1.
  6. Required by:
  7. project :
  8. > Could not resolve com.android.tools.build:gradle:3.6.1.
  9. > Could not get resource 'https://www.jitpack.io/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
  10. > Could not GET 'https://www.jitpack.io/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'. Received status code 400 from server: Bad Request
  11. > Could not resolve com.android.tools.build:gradle:3.6.1.
  12. > Could not get resource 'https://maven.aliyun.com/repository/jcenter/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
  13. > Could not GET 'https://maven.aliyun.com/repository/jcenter/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'. Received status code 400 from server: Bad Request
  14. > Could not resolve com.android.tools.build:gradle:3.6.1.
  15. > Could not get resource 'https://maven.aliyun.com/repository/google/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
  16. > Could not GET 'https://maven.aliyun.com/repository/google/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'. Received status code 400 from server: Bad Request
  17. > Could not resolve com.android.tools.build:gradle:3.6.1.
  18. > Could not get resource 'https://maven.aliyun.com/repository/central/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
  19. > Could not GET 'https://maven.aliyun.com/repository/central/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'. Received status code 400 from server: Bad Request
  20. > Could not resolve com.android.tools.build:gradle:3.6.1.
  21. > Could not get resource 'https://maven.aliyun.com/repository/gradle-plugin/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'.
  22. > Could not GET 'https://maven.aliyun.com/repository/gradle-plugin/com/android/tools/build/gradle/3.6.1/gradle-3.6.1.pom'. Received status code 400 from server: Bad Request
  23. * Try:
  24. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  25. * Get more help at https://help.gradle.org
  26. BUILD FAILED in 1s

可以看到gradle下载完后立马报错,无法下载依赖,明明gradle下载的那么顺畅,依赖怎么可能下载不了呢,考虑了可能原因,最终找到问题是设置了代理。解决方法就是关掉代理设置。

在这里插入图片描述

二、解决方法

1、选择No proxy。

在这里插入图片描述
2、删除gradle.proprities的下面四行内容。

在这里插入图片描述

3、有可能会弹出提示框,直接点OK删除。

在这里插入图片描述

4、再重新sync同步,project构建成功!

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,139人围观)

还没有评论,来说两句吧...

相关阅读