Use resource from .aar library with android.nonTransitiveRClass = true

184 views Asked by At

About my case:

I'm using ZoomSDK by adding .aar files (mobilertc.aar, commonlib.aar) into project. In the :app module, I use some resources from the file mobilertc.aar (like R.drawable.zm_transparent, R.layout.zm_rc_fingers_question,...) My project use Android Gradle Plugin 8.1 so android.nonTransitiveRClass is true as default so the resource files got Unresolved reference error.

If I set android.nonTransitiveRClass is false in the gradle.properties file, my code works well, those errors gone. But the output apk size is too big so I want to keep enabling nonTransitiveRClass for my project.

My question: How can I reference to resource files in .aar library with android.nonTransitiveRClass = true

0

There are 0 answers