Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法解析符号';黄油刀';_Java_Android_Android Studio_Butterknife - Fatal编程技术网

Java 无法解析符号';黄油刀';

Java 无法解析符号';黄油刀';,java,android,android-studio,butterknife,Java,Android,Android Studio,Butterknife,我在试着用黄油刀。但我得到错误“无法解析符号“**ButterKnife”。 我尝试手动导入butterknife.butterknife,但我遇到了相同的错误 我修改了gradle并添加了以下行: 在项目层面 dependencies { classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' } apply plugin: 'com.android.application'

我在试着用黄油刀。但我得到错误“无法解析符号“**ButterKnife”。 我尝试手动导入butterknife.butterknife,但我遇到了相同的错误 我修改了gradle并添加了以下行: 在项目层面

dependencies {
              classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
             }
apply plugin: 'com.android.application' 
apply plugin: 'android-apt'

dependencies { 

   compile 'com.jakewharton:butterknife-compiler:8.5.1'
   apt 'com.jakewharton:butterknife-compiler:8.5.1' 

}
在模块级

dependencies {
              classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
             }
apply plugin: 'com.android.application' 
apply plugin: 'android-apt'

dependencies { 

   compile 'com.jakewharton:butterknife-compiler:8.5.1'
   apt 'com.jakewharton:butterknife-compiler:8.5.1' 

}
我该怎么办? 提前谢谢。 这是我的代码截图,我在那里得到了错误 试试这个

compile 'com.jakewharton:butterknife:8.0.0'
apt 'com.jakewharton:butterknife-compiler:8.0.0'
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'


buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'
    }
}


android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.tanamo.tutorial"
        minSdkVersion 10
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:support-v4:25.2.0'

    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

}
试试这个

compile 'com.jakewharton:butterknife:8.0.0'
apt 'com.jakewharton:butterknife-compiler:8.0.0'
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'


buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'
    }
}


android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.tanamo.tutorial"
        minSdkVersion 10
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:support-v4:25.2.0'

    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

}
请检查一下电话号码。 简而言之,您的依赖项如下所示:

dependencies {
  // ... other dependencies here
  compile 'com.jakewharton:butterknife:8.5.1'
  annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}
请检查一下电话号码。 简而言之,您的依赖项如下所示:

dependencies {
  // ... other dependencies here
  compile 'com.jakewharton:butterknife:8.5.1'
  annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}
试试这个

compile 'com.jakewharton:butterknife:8.0.0'
apt 'com.jakewharton:butterknife-compiler:8.0.0'
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'


buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'
    }
}


android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.tanamo.tutorial"
        minSdkVersion 10
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:support-v4:25.2.0'

    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

}
试试这个

compile 'com.jakewharton:butterknife:8.0.0'
apt 'com.jakewharton:butterknife-compiler:8.0.0'
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'


buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'
    }
}


android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.tanamo.tutorial"
        minSdkVersion 10
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:support-v4:25.2.0'

    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

}
试试这个:

 implementation 'com.jakewharton:butterknife:8.5.1'
 annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
试试这个:

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

这是给我的另一个错误,无法解决'com.jakewharton:butterknife:7.0.1',我想我没有这样做,因为它是一个旧版本,对吧!错误出现在项目级依赖项{classpath'com.android.tools.build:gradle:2.1.0'}模块级应用插件的问题附带的屏幕截图中:“com.android.application”依赖项{compile'com.jakewharton:butterknife:7.0.1'}这是给我的另一个错误,无法解决'com.jakewharton:butterknife:7.0.1',我想我没有这样做,因为它是一个旧版本,对吧!该错误出现在项目级依赖项{classpath'com.android.tools.build:gradle:2.1.0'}模块级应用插件的问题附带的屏幕截图中:“com.android.application'dependencies{compile'com.jakewharton:butterknife:7.0.1'}谢谢您的回复,我查看了官方文档,我一开始是这样设置依赖项的,但我也遇到了同样的错误谢谢回复,我查看了官方文件,我一开始是这样设置依赖项的,但我也遇到了同样的错误,你现在可以检查吗…尝试清理并重建项目…你现在可以检查吗…尝试清理并重建项目…问题就在这里,我用compile'com.jakewharton:butterknife compiler:8.5.1'替换了:compile'com.jakewharton:butterknife compiler:8.5.1'这就是工作问题所在,我用compile'com.jakewharton:butterknife compiler:8.5.1'替换了:compile'com.jakewharton:butterknife compiler:8.5.1'这就是工作