I had the same problem. I was getting this error when writing.
@BindView(R.id.pager) ViewPager pager;
or any other similar syntax for presentation.
The reason for getting this error was that the R file that was imported into my java file was from another package.
Now the question is, why was the imported R file from another package?
This was because I used my project as a library in another project. And when creating the library, I gave a different package name.
source share