Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 573
WoW.j Avatar asked Mar 06 '23 18:03

WoW.j


1 Answers

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'
    })
like image 112
Grishma Ukani Avatar answered Mar 28 '23 15:03

Grishma Ukani