Reputation: 6406
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"):
But the project builds just fine (!):
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?
Upvotes: 0
Views: 1764
Reputation: 6406
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.
Upvotes: 3
Reputation: 317
Have you not done a right-click on getPaymentsComponent() and chosen Go->Definition to see where it takes you ?
Upvotes: 0
Reputation:
Earlier I have same problem because Android Studio makes a lot of files as caches and does not delete them. This can cause trouble when there is a need to make new files, so clearing caches will clear the old cache
may be it solve your problem
go to file menu
and Click invalidate Caches / Restart
.
Upvotes: 3