Q:

String references unrecognized in flavor projects

I have a project with two flavors, "us" and "india", and I am facing issues with the india flavor not being able to recognize string references in a layout file. The layout file, lets say it is layout.xml, is only in the india flavor. Both flavors have strings.xml, however, and the layout.xml references several strings in its own strings.xml that are receiving an error saying that the "resources cannot be resolved". Even though everywhere I set the text to a string-- android:text="@string/text"--are all red and my preview does not work, I am able to compile and run the project. If you view layout.xml it does not look anything like how it is suppose to, but the string references work. The custom layouts that the views have set as backgrounds are invisible. Any idea how to fix this?
Further notes: Initially I had only one manifest.xml thinking that the manifest.xml would be merged between the two flavors and in my layout.xml file in india I was receiving an error on http://schemas.android.com/apk/res/android. I then duplicated the manifest in india flavor and that conflict went away. Point is, I think there may be something bizarre like this that I must do to fix this issue. I have already tried clean, rebuild, File --> Invalidate Cache Restart...Just Restart, rebuild, reset Android Studio, reset my entire computer! 
Anyone have any suggestions?

A:

I figured out solution to this, however, it seems to go against the reasons to use flavors. I had to copy the strings in my "india" flavor strings.xml into my "us" flavor strings.xml too. I was expecting that these string files would merge, but this does not seem to be the case. Similar to how I had to copy my manifest it seems that strings.xml and custom layouts, i.e. buttons in the drawable folder all need to be duplicated in order for previews to work properly and for Android Studio to not complain. 
I hope this can help someone else. Cheers!

