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了!!!

文章来自:http://www.cnblogs.com/zzq-include/p/5930331.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3