With reference to Sample project available
We have a base module and a feature module
From the feature module we do setContentView with a layout located in the base module.
Directly afterwards we manually inflate a layout (layout_a.xml
) inside the base layout (see GoodbyeActivity.java
in bye feature)
Inside this layout_a.xml
we have a simple button with a background resource which is only available in the feature module.
App doesn't run, runtime crash. It compiles without errors.
It seems that the whole idea of splitting up resources is broken. Or am i doing something wrong here?
This error is happening also with anything pointing to feature resources. <include>
statements, strings, dimensions etc. Very annoying that you don't see any build errors as well.
To reproduce this error clone the repo in the link above. Its a clone of the android instant app demo repository.
Open the hello-feature-module en run the instant app with url "http://hello-feature.instantappsample.com/goodbye/example"
In bye feature see the GoodbyeActivity
and layout_a.xml
in the res folder.
If you remove line 29 in the layout_a.xml file the app runs fine.