0

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?

Jay Sidri
  • 6,271
  • 3
  • 43
  • 62
  • Not sure what's up with the down votes - would like to know why. Is this not the right place to ask this? – Jay Sidri Apr 18 '16 at 07:04

3 Answers3

3

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.

3

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.

Jay Sidri
  • 6,271
  • 3
  • 43
  • 62
0

Have you not done a right-click on getPaymentsComponent() and chosen Go->Definition to see where it takes you ?

Richard Goodman
  • 307
  • 3
  • 7