Cannot find symbol class Bind of butterknife
Asked Answered
G

4

8

Somehow I have a mistake in my gradle build. Somehow I cannot find the class Bind of butterknife.

It is probably due to my gradle, but I do not know.

I get this error:

Error:(40, 6) error: cannot find symbol class Bind

My grade file looks like this:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.0'

    defaultConfig {
        applicationId "de.andreasschrade.androidtemplate"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile "com.android.support:appcompat-v7:${android_support_lib_version}"
    compile "com.android.support:design:${android_support_lib_version}"
    compile "com.android.support:cardview-v7:${android_support_lib_version}"

    compile 'com.github.bumptech.glide:glide:3.6.1'
    //compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.squareup.retrofit2:retrofit:2.0.0'
    compile 'com.squareup.retrofit2:converter-gson:2.0.0'

    // api
    //compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:converter-moshi:2.3.0'
    //compile 'com.android.support:design:25.4.0'
    compile 'com.jakewharton:butterknife:8.6.0'
    compile 'com.basgeekball:awesome-validation:2.0'
    compile 'com.facebook.stetho:stetho:1.5.0'
    compile 'com.facebook.stetho:stetho-okhttp3:1.5.0'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    testCompile 'junit:junit:4.12'
    testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
}
Grocery answered 22/7, 2017 at 13:26 Comment(1)
Change minSdkVersion to 15 instead of 14. Or you can use tools:overrideLibrary="com.facebook"Hymettus
B
29

Use @BindView (butterknife:8.6.0) instead of @Bind (butterknife:7.0.1)

Buckner answered 22/7, 2017 at 20:9 Comment(0)
G
1

The Latest version 8.8.1 should use @BindView instead of @Bind

Gretchengrete answered 28/7, 2018 at 11:58 Comment(0)
E
0

You need to change minimum sdk version in your gradle file to 15 instead of 14.

defaultConfig {
    applicationId "de.mynameis.androidtemplate"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
Entomophagous answered 22/7, 2017 at 14:12 Comment(3)
Hi sorry I forgot to update my question, do you have time to have a look at it againGrocery
Can you paste the code where you are using bind class?Entomophagous
import butterknife.BindView;Grocery
C
0

First, update your version of Jakexharton:Butterknife on latest

compile 'com.jakewharton:butterknife:8.6.0'

to

implementation 'com.jakewharton:butterknife:10.2.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'

And change

@Bind 

to

@BindView
Crosswise answered 8/12, 2019 at 23:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.