androidandroid-studiomethodnotfound

Android Studio says "Cannot resolve method" but the project builds correctly


I've just inherited a fairly large Android codebase at work and I've come across a perplexing problem with Android/Android Studio after I've imported the project:

Opening some of the project files, I see a bunch of code highlighted in red (AS reports "Cannot resolve method XXXX"):

enter image description here

But the project builds just fine (!):

enter image description here

The methods in question do not exist AFAICS (I've done a global search for it) and yet, the project builds just fine.

I feel silly asking this but does anyone here know what's going on?


Solution

  • Well, it turned out the project was using Lombok and those methods were auto-generated and Android Studio does not know how to how to handle them unless you install the Lombok plugin for Android Studio.