Search code examples
androidkotlinbuild.gradleandroid-jetpack-composeandroid-jetpack

Creating new compose activity in my existing project am getting build issue


Caused by: [style/AppTheme.NoActionBar] C:\Users\Hp\StudioProjects\robin\app\src\main\res\values\styles.xml [style/AppTheme.NoActionBar] C:\Users\Hp\StudioProjects\robin\app\src\main\res\values\themes.xml: Error: Duplicate resources


Solution

    1. This is because of "style/AppTheme.NoActionBar" already present in your existing project under styles.xml.
    2. You need to check for the themes.xml file under the resources.
    3. This themes.xml file is created by default when you create an empty compose activity.
    4. Deleting this themes.xml will sort out the issue.