简体   繁体   中英

Android Studio styles.xml Error

Ever since I updated android studio to the newest version I've been having this problem:

*Error:Execution failed for task ':app:mergeDebugResources'.

C:\\Android\\AndroidStudioProjects\\materialtest\\app\\src\\main\\res\\values\\styles.xml:8:9: Error: The content of elements must consist of well-formed character data or markup.*

The only problem code appears to be:

  <style name = "AppTheme.Base" parent = "Theme.AppCompat.NoActionBar">
    < item name="colorPrimary">@color/primaryColor</item>
    < item name="colorPrimaryDark">@color/primaryColorDark</item>
    < item name="colorAccent">@color/accentColor</item> </style>

您需要使用正斜杠关闭样式。

<style name = "AppTheme.Base" parent = "Theme.AppCompat.Light.NoActionBar"/>

You need to close your style tag with a forward slash />

It would look something like:

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"/>

or close it with a style tag

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"></style>

This link to Android Developer might provide more detailed information

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM