Could not find com.android.tools.build:gradle:4.0.1 OR 4.0.0 OR any versions

我是研究僧i 提交于 2020-08-10 03:38:51

问题


Error :

Could not find com.android.tools.build:gradle:4.0.1. Searched in the following locations:

https://jcenter.bintray.com/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom

Required by: project : Open File

*** looks like google() and jcenter() are not working as expected.***

I migrated from android studio 2.3.3 to 4.0.1 and this error...

what is my problem???? plz tell me if you need more information .

thank you for your answer :)


回答1:


SOLVED!

go to -> File | Settings | Appearance & Behavior | System Settings | HTTP Proxy, and choose -> manual proxy configuration. set host name: fodev.org and set port number: 8118 . now you must find gradle.properties file. that must be in: Windows: C:\Users\YOURUSERNAME.gradle\gradle.properties OR for Linux: ~/.gradle/gradle.properties . if does't exist, create that yourself. and copy this :

systemProp.http.proxyHost=fodev.org
systemProp.http.proxyPort=8118
systemProp.http.nonProxyHosts=*.jitpack.io, *.maven.org
systemProp.https.proxyHost=fodev.org
systemProp.https.proxyPort=8118
systemProp.https.nonProxyHosts=*.jitpack.io, *.maven.org

now you can sync project.

IMPORTANT : after install build.gradle 4.0.1 (or every version), back this settings to before and remove codes



来源:https://stackoverflow.com/questions/63157065/could-not-find-com-android-tools-buildgradle4-0-1-or-4-0-0-or-any-versions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!