Home > OS >  How to fix Unknown word (CssSyntaxError) in xml file
How to fix Unknown word (CssSyntaxError) in xml file

Time:11-07

I have an error in the line 5 of my styles.xml for my android app with the content below

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
    <style name="LaunchTheme" parent="Theme.AppCompact.Light.NoActionBar">
        <!-- Show a splash screen on the activity. Automatically removed when
             the Flutter engine draws its first frame -->
        <item name="android:windowBackground">@drawable/launch_background</item>
    </style>
    <!-- Theme applied to the Android Window as soon as the process has started.
         This theme determines the color of the Android Window while your
         Flutter UI initializes, as well as behind your Flutter UI while its
         running.

         This Theme is only used starting with V2 of Flutter's Android embedding. -->
         <style name="NormalTheme" parent="Theme.MaterialComponents">
            <item name="android:windowBackground">?android:colorBackground</item>
        </style>
</resources>

I am building an android app with Flutter. This error prevents me from being able to access some widgets. How do I get it solved? I don't know why I'm having this error or what may be causing it.

Here is a screenshot enter image description here

Normally, I'm not supposed to have those errors cause it's a file generated by the Flutter framework itself. I've never had a problem like this. Though, I noticed that the error clears whenever I remove the line with the item tag

CodePudding user response:

At line no. 4 it should be AppCompat instead of AppCompcat, which is unknown word in this case.

P.S. Also in my experience (of Android and Flutter development) mostly, when unknown word/character error occurs, it happens in previous code line/block where error log display it.

  • Related