Bas*_*ANI 0 android butterknife
在我的痛苦之后我findViewById
决定使用ButterKnife
但是好的bug告诉我你永远不会在这里使用ButterKnife是错误的
Android框架包中@InjectView-annotated类错误.
为什么?我的错在哪里?是gradle dependency
错?
我看到这篇文章,但它没有帮助我
gradle文件(模块)
apply plugin: 'com.neenbedankt.android-apt'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
dependencies {
compile 'com.jakewharton:butterknife:8.0.1'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
}
Run Code Online (Sandbox Code Playgroud)
这一行的错误
@BindView(R.id.button_birth_date)
private Button buttonBirthDate;
Run Code Online (Sandbox Code Playgroud)
以及使用@BindView的其他成员变量(视图)
作者杰克沃顿(Jake Wharton),例外情况说:
@InjectView-annotated class incorrectly in Android framework package.
Run Code Online (Sandbox Code Playgroud)
你的类是Android框架包,android..应用程序不应该使用android.或java.*包代码.ButterKnife会急切地拒绝这些包裹.
更改您的包名称.android.alcode.com.material 到something.alcode.com.material
归档时间: |
|
查看次数: |
2262 次 |
最近记录: |