Search code examples
androiddynamic-feature-module

Android feature module dependency on another module not finding resources


I have my base module(Base), a dynamic feature module(A) and a common module(Common) that is not a a dynamic feature, its a library. When I add Common as a dependency of A, I'm able to use classes from it but my build fails because it can't find the resources (error: cannot find symbol R.drawable.myimage) from the Common library.

dependencies {
     implementation project(":Common")
     implementation project(':Base')
}

Is this a dynamic feature constraint or is something causing this?


Solution

  • Turns out R.id.resource will only get the resources from the feature module, com.yourdomain.base.R.id.resource will reference resources of the base module which has access to the resources of the library module.

    This solved my issue.