I have problem with android gradle build. Long story short, I have created 2 flavors:
productFlavors{
abcDemoFree{
}
abcDemo{
}
}
Eeach flavor has his own Activity(Settings.java) and layout(settings_layout.xml) for this activity. From main both files were removed, so Settings.java and settings_layout.xml exist only in flavors.
abcDemoFree
- java
- Settings.java
- res
- settings_layout.xml
abcDemo
- java
- Settings.java
- res
- settings_layout.xml
Android Studio created 4 build variants:
abcDemoFreeDebug
abcDemoFreeRelease
abcDemoDebug
abcDemoRelease
Everything works nice, I am able to create apk with behavior I am expecting from each flavor. Problem is when I switch to one buildVariant, for example to abcDemoDebug, android studio reports bugs from resources file in another flavor, in my example from abcDemoFreeDegub/res/settings_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
</LinearLayout>
These lines
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
generate bugs : URI is not registered.
How to get rid of these errors? Or maybe this is normal behavior?