Reputation: 73
So i want to create a new android project then suddenly i have this error saying Android Resource Linking Failed and below here is my code.
Styles.xml
resources>
<!-- Base application theme. -->
<style type ="attr" name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item type="attr" name="colorPrimary">@color/colorPrimary</item>
<item type="attr" name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item type="attr" name="colorAccent">@color/colorAccent</item>
</style>
</resources>
Error Shown
C:\Users\ASUS\Desktop\Rapih\Re_Mind\app\src\main\res\values\styles.xml:4:5-9:13: AAPT: error: style attribute 'attr/colorPrimary (aka app.com.re_mind:attr/colorPrimary)' not found.
Upvotes: 0
Views: 3248
Reputation: 364
Use something like this do not add type attribute. this might help you.
<style name="AppTheme" parent="Base.Theme.MaterialComponents.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
Upvotes: 1