error: resource style/AppTheme (aka com.example.myapplication:style/AppTheme

created at 10-19-2021 views: 84


Accidentally delete the content under app/src/main/res/values/styles.xml, just add one:

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#A000</item> <!-- Set the color of the title at the top -->
<item name="colorPrimaryDark">#8000</item> <!-- Set the background color above the title -->
<item name="colorAccent">#00f</item> <!-- Response color of input box and button radio box -->

By the way, add the contents of colors.xml and strings.xml.


    <string name="app_name">My Application</string>


<?xml version="1.0" encoding="utf-8"?>
    <color name="purple_200">#FFBB86FC</color>
    <color name="purple_500">#FF6200EE</color>
    <color name="purple_700">#FF3700B3</color>
    <color name="teal_200">#FF03DAC5</color>
    <color name="teal_700">#FF018786</color>
    <color name="black">#FF000000</color>
    <color name="white">#FFFFFFFF</color>
created at:10-19-2021
edited at: 10-19-2021: