Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: style attribute 'attr/colorPrimary' not found

Recently I updated my target SDK to 29 as per new Android guidelines but after that I received this error:

D:\Android Apps\PatherPane\app\src\main\res\values\styles.xml:4:5-9:13: AAPT: error: style attribute 'attr/colorPrimary (aka com.patherpane.app:attr/colorPrimary)' not found.

And my style XML file is:

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
<style name="SplashScreen" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowBackground">
        @drawable/background_splashscreen
    </item>
</style>

How can I fix this?

This command followed by item names is showing the error: Theme.AppCompat.Light.DarkActionBar

like image 400
ProgrammerX Avatar asked Aug 20 '20 19:08

ProgrammerX


1 Answers

Make sure you have not missed appcompat implementation in build.gradle(app)

implementation ‘com.android.support:appcompat-v7:28.0.0’

or

implementation 'androidx.appcompat:appcompat:1.2.0'

if using androidx

like image 155
alexmro Avatar answered Sep 17 '22 04:09

alexmro