butterknife issue : error: <identifier> expected

butterknife issue : error: <identifier> expected

你好,我是 运行 一个包含 butterknife 的项目,一切正常,但我正在尝试编译它,我在这段代码中得到了这个 import butterknife.@BindView; import butterknife.ButterKnife; 这是我的 gradle 文件 请打赏一下

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 27
        flavorDimensions "default"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }




    /****************************
     * Change the given field below
     * *************************`**/

    productFlavors {
        wavie {
            applicationId "com.amiapp.wp.wavie" // change package name to something else before uploading to google play
            resValue "string", "app_name", "Wavie" // change app name to something else before uploading to google play
            buildConfigField "boolean", "FULL_VERSION", "false"
           resValue "string", "admob_full_ad", "" // Add your admob intertial unit id here
            manifestPlaceholders = [appIcon: "@mipmap/ic_launcher"]
            versionCode 1
            versionName "1"
        }

        waviepro {
            applicationId "com.amiapp.wp.wavie" // change package name to something else before uploading to google play
            resValue "string", "app_name", "Wavie Pro"  // change app name to something else before uploading to google play
            buildConfigField "boolean", "FULL_VERSION", "true"
           resValue "string", "admob_full_ad", "" // don't add any ad unit here because this is a paid version.
            manifestPlaceholders = [appIcon: "@mipmap/ic_launcher2"]
            versionCode 1
            versionName "1"
        }
    }


}

dependencies {
   final SUPPORT_LIB_VERSION = '27.0.2'
    final COLOR_PICKER_VERSION = '1.5'
    final BUTTER_KNIFE_VERSION = '8.4.0'

    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.google.android.gms:play-services-ads:11.8.0'
    //noinspection GradleCompatible
    compile "com.android.support:appcompat-v7:27.0.2"
    compile "com.larswerkman:HoloColorPicker:1.5"
    compile 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    compile project(':library')
}
apply plugin: 'com.jakewharton.butterknife'

和我的项目gradle

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

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenCentral()
        jcenter()
        google()


    }
}

感谢任何帮助,在此先感谢 Amine。

butterknife gradle 3.0.1 存在问题。使用 9.0.0-SNAPSHOT

使用这个

classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'

依赖关系

implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'