Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ButterKnife findByID method is deprecated in version 8.8.0

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
...
like image 307
Narek Hayrapetyan Avatar asked Aug 04 '17 23:08

Narek Hayrapetyan


People also ask

Is findByID deprecated?

android - ButterKnife findByID method is deprecated in version 8.8.

Is ButterKnife deprecated?

This tool is now deprecated.

How do you use ButterKnife in kotlin Android?

Implement Click Listeners for Buttons The first is using setOnClickListener and a lambda function. Then, we will use ButterKnife's @OnClick annotation. Add the following code inside the onCreate() method. Place the code on a new line just below ButterKnife.

What is ButterKnife in Android?

Butterknife is a light weight library to inject views into Android components. It uses annotation processing. The @BindView annotation allow to inject views and performs the cast to the correct type for you. The @@OnClick(R.


1 Answers

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.

like image 70
Jake Wharton Avatar answered Oct 21 '22 07:10

Jake Wharton