Butterknife: Android Studio 3.1 Gradle 4.1 can't use.

Created on 4 Jan 2018  ·  4Comments  ·  Source: JakeWharton/butterknife

Most helpful comment

Already solved this problem .Through this articlehttps://medium.com/@ocittwo/butterknife-project-android-studio-3-0-91e0562b0467
Project level build.gradle:
````
buildscript {

ext.butterknife_version = '9.0.0-SNAPSHOT'
ext.SUPPORT_LIBRARY_VERSION = '26+'
repositories {
    google()
    jcenter()
    mavenCentral()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
````

App module build.gradle:
` apply plugin: 'com.android.application' apply plugin: 'com.jakewharton.butterknife' dependencies { implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT' annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT' }
`

All 4 comments

You have to use 9.0.0-SNAPSHOT for now

Already solved this problem .Through this articlehttps://medium.com/@ocittwo/butterknife-project-android-studio-3-0-91e0562b0467
Project level build.gradle:
````
buildscript {

ext.butterknife_version = '9.0.0-SNAPSHOT'
ext.SUPPORT_LIBRARY_VERSION = '26+'
repositories {
    google()
    jcenter()
    mavenCentral()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
    classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
````

App module build.gradle:
` apply plugin: 'com.android.application' apply plugin: 'com.jakewharton.butterknife' dependencies { implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT' annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT' }
`

this code is not working in android studio 3.2.1 get some error

    @com.jk.kangdi.BindView(R.id.call)
    Button call;
    @com.jk.kangdi.BindView(R.id.ConferenceCall)
    Button ConferenceCall;
    @com.jk.kangdi.BindView(R.id.endCall)
    Button endCall;

but jk is not finde

Was this page helpful?
0 / 5 - 0 ratings