首页 > 代码库 > butterknife异常提示:attribute value must be constant

butterknife异常提示:attribute value must be constant

就是因为你的android工程师lib的

如:

apply plugin: ‘com.android.library‘android {    compileSdkVersion 23    buildToolsVersion "23.0.3"    defaultConfig {        minSdkVersion 14        targetSdkVersion 23        versionCode 1        versionName "1.0"    }    buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile(‘proguard-android.txt‘), ‘proguard-rules.pro‘        }    }}

这样你在R.id.xxx 取R中变量的时候并非是final类型,所以只能老老实实findviewbyid了!!!

butterknife异常提示:attribute value must be constant