android / codelab-android-dynamic-features

Apache License 2.0
121 stars 47 forks source link

Is there a sample that shows how to use this for modules that aren't directly used by the App Module? #21

Closed casolorz closed 4 years ago

casolorz commented 4 years ago

I've looked over Google's examples and codelabs and they look pretty simple but they are for modules that the main app access directly. My problem is that I have a module that the main app never access directly.

Basically I have this:

App -> Module A -> Module B -> Module C

So App imports A as a gradle implementation, A imports B and B imports C.

I want C, that is rarely used and large, to be a dynamic module.

I've already set C to be apply plugin: 'com.android.dynamic-feature' but I'm getting stuck on the dependencies.

If I set dynamicFeatures = [':C'] inside the gradle file of B, it fails because Could not set unknown property 'dynamicFeatures' for object

If I set the dynamycFeatures plus the implement line on App I get Unable to resolve dependency for ':app@prodDebug/compileClasspath': Could not resolve project :C

So how do I do this with this project hierarchy?

Thanks.

keyboardsurfer commented 4 years ago

Hi @casolorz. We're working on an updated sample at https://github.com/android/app-bundle-samples and will be considering feature-on-feature dependencies there.