Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Multimodular Android App: Unable to access Strings from another module

I am trying to modularize my application and I have a shared module where I put my shared resources and strings.
In my module I have a dependency to the shared module as following:

implementation(project(Modules.shared))

Let’s say I am working in Onboarding Module. When I want to call R.string.mystring, mystring is not found.
But when I write packageNameOfSharedModule.R.string.mystring, it works.

In another projects, I can access any resource from the current modul’s package.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

What I am missing ? Thanks in advance!

>Solution :

That would be "non-transitive R files"

https://blog.blundellapps.co.uk/speed-up-your-build-non-transitive-r-files/

Check if you have this in your gradle.properties file:

android.nonTransitiveRClass=true
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading