Issue
I have the following structure of android project
- application module
- base feature module
- feature module
- a local library project
- remote libraries
When I try to include the local library project in base feature module with api or implementation, the feature either not compiling because of not found resources or throwing the same errors at runtime. And now I am wondering is there a point which I misunderstood. The documentation says the base feature module is intended to share the common code and the resources, but it seems it doesn't cover the library cases.
The runtime resource not found errors are thrown when I try to include the same library also in the feature module.
Solution
When referecing resources from base module in your feature modules you need to use the full packageName qualifier.
This is because in instant apps they will belong to another name space.
Hence:
R.id.resource will point to resources of your feature module
com.yourdomain.appbase.R.id.resource will reference resources of your base module
Answered By - gbaccetta
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.