“failed to resolve x” errors after updating to Android studio to 2.2

拟墨画扇 提交于 2019-12-10 11:56:49

问题


Google launched Android Studio 2.2, so I updated my Android studio 2.1 to Android Studio 2.2 When i make a Project I get these errors (and more):

Error:Failed to resolve: javax.inject:javax.inject:1

Error:Failed to resolve: com.google.code.findbugs:jsr305:2.0.1

Error:Failed to resolve: javax.annotation:javax.annotation-api:1.2


回答1:


I have recently installed 2.2 version of Android Studio and I am also facing this problem. But don't worry just follow the following simple steps.

  1. Connect your computer to internet
  2. Refresh your project (option is in menu strip)
  3. Clean your project (option in build menu)
  4. And again refresh your project. This will hopefully resolve this issue.
  5. Again sync your project (if still facing this issue)



回答2:


I had the same problem and it turned to be that my proxy settings changed. That was why I couldn't connect and download any libs.

You can check it at File -> Settings -> System Settings dropdown -> HTTP Proxy.

Or

in gradle.properties at project level:

systemProp.https.nonProxyHosts=*.yourdomain.com, 192.168.*
systemProp.https.proxyPort=yourPort (ex.  8080)
systemProp.http.proxyHost=xx.xx.xx.xx
systemProp.http.nonProxyHosts=*.yourdomain.com, 192.168.*
systemProp.https.proxyHost=xx.xx.xx.xx
systemProp.http.proxyPort=yourPort (ex.  8080)


来源:https://stackoverflow.com/questions/39600965/failed-to-resolve-x-errors-after-updating-to-android-studio-to-2-2

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