WoW.j
WoW.j

Reputation: 205

How to fix Failed to resolve: support-compat

Why not help me?

In my application I want use ButterKnife library and I add this library dependencies. But when add this library and when click on Sync button.
Not sync project and show me error.

gradle.Build (project) :

buildscript {

    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}

gradle.build (app) :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.mohammad.ncistutorial"
        minSdkVersion 14
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}

Error message :

Failed to resolve: support-compat

How can I fix it?

Upvotes: 4

Views: 4694

Answers (3)

Dhanasekaran
Dhanasekaran

Reputation: 1

check your .gradle file version. Update or change latest gradle version.

Upvotes: 0

Hossein Hajizadeh
Hossein Hajizadeh

Reputation: 1485

use this code

   implementation 'com.jakewharton:butterknife:9.0.0-rc2',{
        exclude group: 'com.android.support'
    }

Upvotes: 0

Grishma Ukani
Grishma Ukani

Reputation: 656

Please try to add depedency line with exclude group of support of app compact.

implementation 'com.jakewharton:butterknife:8.8.1',{
        exclude group: 'com.android.support'
    })

Upvotes: 7

Related Questions