Reputation: 253
I get this error when I build my project:
error: duplicate class: class_name$$ViewInjector
This is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.stel.order"
minSdkVersion 9
targetSdkVersion 19
}
buildTypes {
release {
runProguard true
proguardFiles 'proguard-project.txt'
}
}
}
dependencies {
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.jakewharton:butterknife:6.0.0'
...
}
If I clean the project, it builds without errors, but when I run the project, I get this error.
Upvotes: 3
Views: 1110
Reputation: 11
1: Remove the eclipse project .apt_generated file folders and .factorypath 2: Remove .classpath file node 3: re-imported into the android studio
1:删除eclipse项目中的.apt_generated文件夹和.factorypath文件 2:删除.classpath文件中的节点 3:重新导入到android studio中
Upvotes: 0
Reputation: 1781
It happened with me too when I migrated from Eclipse. All you need is to delete files path.OuterClass$$ViewInjector
in your project manually.
Upvotes: 4