finds.dev← search

// the find

JakeWharton/butterknife

★ 25,337 · Java · Apache-2.0 · updated Sep 2023

Bind Android views and callbacks to fields and methods.

Butter Knife is Jake Wharton's annotation-processing library for Android that eliminates findViewById boilerplate by generating view-binding, resource-binding, and click-listener code at compile time. It's for Android developers on older, view-based (non-Compose) codebases, though the project itself says not to start new work with it.

The annotation processor is mature and battle-tested at scale (25k+ stars, years of production use), with a real compiler test suite (BindingSetTest) rather than just runtime tests. It covers more than just view binding — resources, colors, dimens, fonts, drawables, and listener methods (@OnClick, @OnItemClick, etc.) all get the same treatment. The included Lint module (InvalidR2UsageDetector) catches a real footgun of the library (misusing R2) at build time instead of failing silently at runtime.

It's officially deprecated by the author in favor of Android's native View Binding — the README states only critical AGP compatibility fixes will land, no new features or general bug fixes. Annotation processing means slower incremental builds compared to View Binding's direct codegen from XML, which is exactly why Google's replacement exists. Library modules require the R2 indirection (a synthetic R class) because annotation values must be compile-time constants, which is a well-known source of confusion for newcomers. Last real activity was 2023, so it won't track newer AGP or Kotlin releases going forward.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →