How to fix failed to resolve :com.android.support :appcompat-v7:27.+'-error

Easy way to fix
just open your android project

How to fix failed to resolve :com.android.support :appcompat-v7:27



open build.gradle(Master file)
and add this line to
if your android version is less than 3

repositories {
jcenter()
        mavenLocal()
        mavenCentral()
        maven {                                  // <-- Add this
            url 'https://maven.google.com/'
            name 'Google'
        }
    }

if your android version is greater than 3
than
repositories {
jcenter()
      mavenLocal()
      mavenCentral()
      google()        //---> Add this
}

Also add in allproject file

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

Now open your build.gradle file in app

and add this implementation
dependencies {
    implementation 'com.android.support:appcompat-v7:27.+'
    implementation "com.android.support:support-core-utils:27.1.1"
}

How to fix failed to resolve :com.android.support :appcompat-v7:27

Run your project and you are done

No comments

Powered by Blogger.