Error with Android Style

Asked

Viewed 51 times

0

I am unable to compile my project, I get the following error

<type> attribute is required for <item>

inserir a descrição da imagem aqui

Here’s my xml style.

<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MyTheme" parent="MyTheme.Base">
</style>
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- O Erro está nessa linha abaixo-->
<item name="windowNoTitle">true</item>

<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primaryDark</item>
<item name="colorAccent">@color/accent</item>

</style>
<item name="elevation">0dp</item>
<style name="MyTheme.Base" parent="Theme.AppCompat.Light">
</style>

<style name="MyTheme" parent="MyTheme.Base">
</style>

<style name="MyTheme.Splash" parent ="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/tbbt</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
</resources>

Error is on line 8.

1 answer

2


According to the documentation, an element <item> must be a child of <style>. Review the following excerpt from your file:

<item name="elevation">0dp</item>

Note that he does not have a father <style>.

  • Thank you very much. I didn’t notice this little detail.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.