ButterKnife findByID method is deprecated in version 8.8.0

落花浮王杯 提交于 2019-12-10 01:54:47

问题


Hi I have just updated ButterKnife library version 8.7.0 to 8.8.0

compile 'com.jakewharton:butterknife:8.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.0'

and found that:

findById(view, id);

is deprecated, why? what method to use instead? but when reverting version to 8.7.0 (or earlier) deprecated warning disappears.

compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
    applicationId "com.some.app"
    minSdkVersion 21
    targetSdkVersion 25
...

回答1:


Per the change log:

Deprecate the findById methods. Compile against API 26 and use the normal findViewById for the same functionality.

Android'sfindViewById has been updated to have the same functionality in API 26 which recently became stable, thus allowing Butter Knife's version to be deprecated and removed in the forthcoming v9.0.



来源:https://stackoverflow.com/questions/45516753/butterknife-findbyid-method-is-deprecated-in-version-8-8-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!