问题
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.
- Connect your computer to internet
- Refresh your project (option is in menu strip)
- Clean your project (option in build menu)
- And again refresh your project. This will hopefully resolve this issue.
- 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