Failed to resolve: com.android.support:customtabs:

2019-04-20 03:27发布

问题:

This question already has an answer here:

  • Android studio default project fails: Error:Failed to resolve: com.android.support:support-v4:25.2.0 3 answers
  • Failed to resolve: com.android.support:cardview-v7:26.0.0 android 23 answers

I have these two errors:

Failed to resolve: com.android.support:custom tabs:[26.0.0,26.1.0]

Failed to resolve: com.android.support:support-v4:[26.0.0,26.1.0]

回答1:

Now Android support package disturbs over network(starts from 25.4), so your project's build.gradle file should include that:

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

UPDATE

Also you can add google() instead of maven{url "..."}:

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