0
votes

I'm trying to build my Android Project but when I rebuild I receive this error message:

Could not find com.jakewharton:butterknife-compiler:5.1.2. Searched in the following locations: file:/C:/Android/android-sdk/extras/m2repository/com/jakewharton/butterknife-compiler/5.1.2/butterknife-compiler-5.1.2.pom

file:/C:/Android/android-sdk/extras/m2repository/com/jakewharton/butterknife-compiler/5.1.2/butterknife-compiler-5.1.2.jar file:/C:/Android/android-sdk/extras/google/m2repository/com/jakewharton/butterknife-compiler/5.1.2/butterknife-compiler-5.1.2.pom file:/C:/Android/android-sdk/extras/google/m2repository/com/jakewharton/butterknife-compiler/5.1.2/butterknife-compiler-5.1.2.jar file:/C:/Android/android-sdk/extras/android/m2repository/com/jakewharton/butterknife-compiler/5.1.2/butterknife-compiler-5.1.2.pom file:/C:/Android/android-sdk/extras/android/m2repository/com/jakewharton/butterknife-compiler/5.1.2/butterknife-compiler-5.1.2.jar https://jcenter.bintray.com/com/jakewharton/butterknife-compiler/5.1.2/butterknife-compiler-5.1.2.pom https://jcenter.bintray.com/com/jakewharton/butterknife-compiler/5.1.2/butterknife-compiler-5.1.2.jar https://dl.google.com/dl/android/maven2/com/jakewharton/butterknife-compiler/5.1.2/butterknife-compiler-5.1.2.pom https://dl.google.com/dl/android/maven2/com/jakewharton/butterknife-compiler/5.1.2/butterknife-compiler-5.1.2.jar Required by: project :app

This is my build.gradle module:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
defaultConfig {
    applicationId "com.wakeup.xxx"
    minSdkVersion 18
    targetSdkVersion 25
    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(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:25.1.1'
testImplementation 'junit:junit:4.12'
implementation 'com.jjoe64:graphview:4.2.2'
implementation 'com.jakewharton:butterknife:5.1.2'
annotationProcessor 'com.jakewharton:butterknife-compiler:5.1.2'


// https://mvnrepository.com/artifact/com.jakewharton/butterknife
}

buildscript {
repositories {
    google() // <--here
}
}

allprojects {
repositories {
    google() // <-- here
}
 }

Can someone help me?

1
Your project :app is missing a butter knife reference. This normally happens when you forgot to define your module dependencies correctly. Please post your build.gradle file. - André Sousa
just added tanks - Jayme Oliveira

1 Answers

0
votes

Your project :app is missing a butter knife reference. From the documentation this is what you are missing:

repositories {
    mavenCentral()
}

Also, the version you are using 5.1.2 does not exists:

{ "errors" : [ { "status" : 404, "message" : "Could not find resource" } ] }

Try the following file:

apply plugin: 'com.android.application'

buildscript {
    repositories {
        google()
        mavenCentral()
    }
}

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

android {
    compileSdkVersion 26
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "com.wakeup.xxx"
        minSdkVersion 18
        targetSdkVersion 25
        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(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    implementation 'com.android.support:appcompat-v7:25.1.1'
    testImplementation 'junit:junit:4.12'
    implementation 'com.jjoe64:graphview:4.2.2'
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}