Saliou seck
01/31/2024, 3:40 PMbashCopy code
Execution failed for task ':app:mergeDebugResources'.
> [style/AppTheme] /Users/ckroot/StudioProjects/leukseller/app/src/main/res/values/styles.xml [style/AppTheme] /Users/ckroot/StudioProjects/leukseller/app/src/main/res/values/themes.xml: Error: Duplicate resources
themes.xml
<resources>
<style name="AppTheme" parent="android:Theme.Material.Light.NoActionBar" />
<!-- <style name="AppThemeCompose" parent="android:Theme.Material.Light.NoActionBar" />-->
</resources>
styles.xml
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/colorWindowBackground</item>
</style>
To fix the error, I modified the themes.xml
file generated by Compose by changing the name to AppThemeCompose
instead of AppTheme
.
<style name="AppThemeCompose" parent="android:Theme.Material.Light.NoActionBar" />
After this change, I am able to compile, but the theme defined by Compose does not change. I have changed the primary and secondary colors, but the changes have no effect on the Activity that uses Compose. It only displays the default color generated by Compose when generating the Activity using Compose.
Thank you in advance.Chrimaeon
01/31/2024, 4:56 PMSaliou seck
01/31/2024, 5:13 PM