2

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?

3 Answers 3

2

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.

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

Comments

0

Import your library module (Common) by using

File --> New --> Import Module

you can always try a

Invalidate Caches & Restart

(awkwardly solves most issues with Android Studio)

1 Comment

Thank you, I tried but it didn't work. I posted what worked for me.
0

Install SplitCompat in dynamic feature activity

override fun onAttach(context: Context?) {
super.onAttach(context)
SplitCompat.install(context)
}

You can refer official dynamic delivery documentation

https://github.com/arpitagarwal1301/AndroidHub/issues/8

1 Comment

I'm getting the error while trying to build not during run time. The linked issue seems to be a run time error?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.