0

I have one project with two modules: the app and the lib. Obviously the app module depends of the lib module. However I need that the lib module uses resources (image drawables) from app module. Is possible?

2 Answers 2

2

No, because all library modules are compiled first, and they do not have any access to the application resources at this point. A library module must include all of the resources it is dependent on by definition. Only when the application is compiled do its resources get built into the relevant R classes, at which point the library is already fully compiled.

Sign up to request clarification or add additional context in comments.

Comments

0

No. The problem is that resource id-s are assigned dynamically, so you can't refer to a resource from a library, since its id is unpredictable.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.