gpt4 book ai didi

java - 无法解析符号 'ButterKnife'

转载 作者:行者123 更新时间:2023-12-01 20:57:13 28 4
gpt4 key购买 nike

我正在尝试使用 butterknife 。但我收到错误“无法解析符号'**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'

}

我该怎么办?提前致谢 。这是我收到错误的代码的屏幕截图 link for the screenshot

最佳答案

apply plugin: 'com.android.application'
android {
compileSdkVersion XX
buildToolsVersion "XX.0.0"
defaultConfig {
applicationId "com.xxxxx.xxx"
minSdkVersion xx
targetSdkVersion xx
versionCode x
versionName "x.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}


apply plugin: 'com.neenbedankt.android-apt'


dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
testCompile 'junit:junit:4.12'

compile 'com.android.support:multidex:1.0.1'
compile 'com.google.code.findbugs:jsr305:2.0.1'
compile 'com.android.support:design:25.1.1'
compile 'com.jakewharton:butterknife:8.0.1'

apt 'com.jakewharton:butterknife-compiler:8.0.1'
testCompile 'junit:junit:4.12'
}

关于java - 无法解析符号 'ButterKnife',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42155896/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com