Ali Zarei
Ali Zarei

Reputation: 3753

Android Studio Failed to resolve: support-core-utils

After upgrading support library version to 27.1.1 when i sync the project i face with below error:

Failed to resolve: support-core-utils

Any idea?

here is my project level build file:

    buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

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

and app level build file:

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'

Upvotes: 33

Views: 16841

Answers (7)

Franklin CI
Franklin CI

Reputation: 171

do you add implementation 'com.android.support:design:XX.X.X', implementation 'com.android.support:support-v4:XX.X.X' ? when I saw "duplicate value for resource" message I just had implementation 'com.android.support:appcompat-v7:28.0.0'

and I added implementation 'com.android.support:design:28.0.0'

implementation 'com.android.support:support-v4:28.0.0' and worked it !

Upvotes: 1

Mohammad Sommakia
Mohammad Sommakia

Reputation: 1833

Remove mavenCentral() from repositories script in project level if there.

Upvotes: 0

Mahdi-Malv
Mahdi-Malv

Reputation: 19250

I had the same problem with AppCompat library with version 28.0.0. I fixed it by using 28.0.0-alpha1. None of answers helped me.

Android studio 3.1.4
Target and compile sdk 28.

At the time the library was not really stable. support-core-utils is a part of android-support-v4, so if you still have a problem with that try adding
implementation 'com.android.support:support-v4:27.1.1'
to the dependencies.

Upvotes: 2

Sam
Sam

Reputation: 6395

as per behavior changes in android-Gradle plugin (v3.2.0 September 2018) you need to keep the google repository as the first entry

buildscript {
      repositories {
          google() // here
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.2.0'
      }
  }
  allprojects {
      repositories {
          google() // and here
          jcenter()
  }

android-Gradle plugin release note

Upvotes: 34

nawaab saab
nawaab saab

Reputation: 1902

I solved this by setting google() as first entry in allprojects/repositories in top level build.gradle

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

Upvotes: 87

Ali Zarei
Ali Zarei

Reputation: 3753

In my case , it was because of a library dependency and I solved by excluding support-core-utils from that library :

implementation ('com.github.chrisbanes:PhotoView:2.0.0'){
    exclude module: 'support-core-utils'
}

Upvotes: 10

Doan Bui
Doan Bui

Reputation: 4426

I have same problem and i changed to successful. Added maven { url 'https://maven.google.com' } as first entry in allprojects/repositories in top level build.gradle

Upvotes: 11

Related Questions