0

I have a multi-module project with base-feature and feature modules.

The problem is that after the build the resources from feature module are duplicated with a second id and the resources are not merged properly in the end. Is there a something about the gradle plugin which should be done to make this run? ==> com.android.feature

When I run the project it tries to find the resource from feature module with the feature module resource id, but in the end the main module has the same resource already with another id, which I guess should be merged.

Prags
  • 2,457
  • 2
  • 21
  • 38
X-HuMan
  • 1,488
  • 1
  • 17
  • 37
  • it is probably related to the same issue described here: https://stackoverflow.com/questions/44614343 There is a tracker we opened here: https://issuetracker.google.com/issues/62852384. Please star it if you consider it is the same problem: – gbaccetta Jul 05 '17 at 13:51

1 Answers1

2

This is an intended behavior. Please make sure that your resource IDs are unique. Refer to this Android Instant Apps FAQ: “Can I share resources between features?”

https://developer.android.com/topic/instant-apps/faqs.html#project-structure

However, you must keep the IDs for your resources unique between your dependent features and base feature. For example, if your base feature provides a resource with the ID R.id.feature_layout and a dependent feature defines another resource with the same ID, the instant app uses the resource from the base feature instead of the dependent feature.

Julia K
  • 561
  • 5
  • 11
  • Trying to use the resource from another module or from base is fine, but not finding the resource in feature module from the same feature module, seems to me not right. In a small sample project it is fine, but in a big projects it seems the resource processing is not successful. – X-HuMan Jul 19 '17 at 13:42
  • By the way I was speaking about the generated integer IDs, but not the names. – X-HuMan Jul 19 '17 at 14:17
  • I am not sure if your issue is the same as gbaccetta’s (https://issuetracker.google.com/issues/62852384), but if it is, could you add to it with your reproducible project? Otherwise, please file a new one, then link to it back in here, thanks! https://issuetracker.google.com/issues/new?component=316045&template=1018787 – TWL Jul 25 '17 at 23:39