Could not find com.android.tools.build:gradle:3.0.1

后端 未结 3 396
终归单人心
终归单人心 2021-02-02 18:10

When I try to build my project with gradle wrapper I get this error:

./gradlew

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred c         


        
相关标签:
3条回答
  • 2021-02-02 18:43

    just wanted to leave an extra tip. When I installed Android Studio, I read somewhere that it was recommended to leave this configuration (with the '+' symbol)

    build.gradle (project)

    dependencies {
            classpath 'com.android.tools.build:gradle:+'
            .....
            #more lines here
    }
    

    However, the project I am using uses an old version of gradle, and this line always requested the latest version. Took me a while to figure it out.

    0 讨论(0)
  • 2021-02-02 19:02

    Check your proxy setting on Android Studio

    File > Settings > Appearance

    &

    Behavior > System Settings > HTTP Proxy

    0 讨论(0)
  • 2021-02-02 19:08

    Here was how I resolved the issue. Change the root build.gradle file:

    dependencies {
            classpath 'com.android.tools.build:gradle:3.1.3'
    
        .....
            //other codes here
        }
    
    0 讨论(0)
提交回复
热议问题