In an android project which consists of a library project, I need to have a different theme set in manifest for main app and library. Like I need to set below theme in the main project
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/grey</item>
<item name="colorPrimaryDark">@color/black</item>
<item name="colorAccent">@color/green</item>
</style>
and the one below for library project
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/blue</item>
<item name="colorPrimaryDark">@color/red</item>
<item name="colorAccent">@color/white</item>
</style>
Library project styles are overridden by main app styles. when I give different names for styles it throws manifest merger conflict error.
Below is the manifest of main app
<application
android:name=".MyApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
and this one is for library
<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>