0

Well it's actually not in the library itself, it's in a different library which depends on the annoration processor.

I have the roughly the following project structure.

Annotation Processor -> Android Library module -> Android App module

In the Android app I use annotations on some classes and the processor generates class that I'd like to use (and call its methods) in the library module. Is that even possible? Right now I can only access it from the App module itself.

I actually feel like it all quite makes sense, just wonder if there is some way how to workaround that.

(When I pull the classes referencing generated code from the library module into app module itself, it works perfectly, I just want to have them in the library)

simekadam
  • 7,334
  • 11
  • 56
  • 79

1 Answers1

2

So far the only solution I was able to come up with was to not use the generated class itself, but rather define an interface, use that and let the code generator generate an implementation of it. Then provide the implementation from the app module back to the library module at runtime.

simekadam
  • 7,334
  • 11
  • 56
  • 79