Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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'
like image 843
Ali Zarei Avatar asked Apr 07 '18 13:04

Ali Zarei


5 Answers

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"
        }
    }
}
like image 111
nawaab saab Avatar answered Nov 13 '22 16:11

nawaab saab


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

like image 20
Sam Avatar answered Nov 13 '22 15:11

Sam


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

like image 11
Doan Bui Avatar answered Nov 13 '22 15:11

Doan Bui


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'
}
like image 10
Ali Zarei Avatar answered Nov 13 '22 14:11

Ali Zarei


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.

like image 2
Mahdi-Malv Avatar answered Nov 13 '22 16:11

Mahdi-Malv