Could not resolve com.android.support:appcompat-v7:26.1.0. => configure HTTP proxy

前端 未结 1 1268
夕颜
夕颜 2021-01-14 00:29

I downloaded Android Studio 3.0 and I started following along building my first app tutorial. But Gradle threw errors like:

Could not resolve com.andr

相关标签:
1条回答
  • 2021-01-14 01:30

    I had the same error. Tried a lot of stackoverflow links but none of them helped until this one. The problem in my case was due to https proxy settings which were not there in the gradle.properties file. I included it and it worked.

    For android studio 3, inside build.gradle file of your project you have this:

    allprojects {
        repositories {
            jcenter()
            google()
        }
    }
    

    The jcenter() runs over https and hence if you are building in a network(in most cases company network) which uses https proxy, and you forgot to include it in your gradle.properties file, then you are likely to face the issue. You may feel that gradle is behaving weird but its not. Its only missing the proper network configuration. Even offline build settings wont work since it still needs jcenter() to download files for the first time you are building an app in latest Android Studio.

    I included my https proxy settings in gradle.properties like this:

    systemProp.https.proxyHost=<proxy server address>
    systemProp.https.nonProxyHosts=localhost, 127.0.0.1
    systemProp.https.proxyPort=<port number>
    
    0 讨论(0)
提交回复
热议问题