Q:

Android: Gradle compilation error expects element value to be a constant expression - Feature Module

This is my first multi-module project.
This login activity exists in a Feature Module which gets many of its dependencies from a Base Feature Module.
I'm getting the error error: element value must be a constant expression on lines where I'm using @BindView with my TextInputEditText and Button.
Also, I noticed that the import for the R class is missing, yet none of the R.id. are in red. Why is that?

A:

Feature modules are similar to library modules. Once you move from an application module to a library/feature module, your R class fields aren't final constants anymore. That's why the issue happens. To fix this,  you will need to switch to Butterknife's R2 class.
More info in the links below:

Official documentation: https://github.com/JakeWharton/butterknife#library-projects
Android: Why do we need to use R2 instead of R with butterknife?
https://github.com/JakeWharton/butterknife/issues/1113 <- This mentions you may need ButterKnife 9.0

