I am trying to implement Dynamic delivery type App. First I create new project after that create Module for dynamic steps for this
Select File > New > New Module from the menu bar and Create New Module dialog, select Dynamic Feature Module and click Next.
structure of folder
I crate class and want to access resource folder for use of layout , drawable folder.
Also implemented in main module gradle
implementation 'com.google.android.play:core:1.2.0' and dynamicFeatures = [":dynamic_feature"]
but getting error for dynamic module Error display
error: cannot find symbol variable activity_main
error: cannot find symbol variable iv_forward
error: cannot find symbol variable seekBar
https://developer.android.com/studio/projects/dynamic-delivery https://proandroiddev.com/dynamic-feature-module-android-ondemand-module-android-app-bundle-ea0d872b32d
For those who are faced with the same problem: You can only get resources from base module. Use:
com.example.base_module.R.drawable.item
instead off default R.drawable.item
If you are inside dynamic feature module and trying to access the drawable of another module. You should add the the package name of that module (in which drawable is located) as prefix like below
btnOk.setImageResource(com.example.mysampleproject.R.drawable.Ok)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With