Skip to content
Advertisement

Gradle (Java) cannot find symbol for class in subdirectory of package

It’s been some years since I have programmed Java and I am having trouble with resolving a build issue with not finding a symbol for a class in the same package directory structure.

JavaScript

The following class is attempting to reference Manager. Note the package declarations for both classes.

JavaScript

I am importing com.A.B.C.Manager in other source files and able to reference Manager there but, for this source file, Gradle cannot resolve the symbol.

What am I missing? (This is an Android project by the way, in case that is relevant.)

In advance, thank you.

Advertisement

Answer

That Manager class have to implement Application.ActivityLifecycleCallbacks like this:

JavaScript

Also, I guess you missed the new while calling registerActivityLifecycleCallbacks() :

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement