0

I have installed the android studio 3.1.3 version, after writing some code I was getting some error, to resolve that error I upgraded the Gradle version from 4.4 to 4.6 and Android plugin version from 3.1.3 to 3.2.0-alpha18. It resolved that old error but received the new error. I am showing the complete error in screen shot. enter image description here

Errors:

com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed

Please help me out to this problem.

style.xml

<resources>

    <!-- Base application theme. -->
    <style name="AppThemeLogin" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
    <!-- Base application theme. -->
    <style name="AppThemeLogin.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
    <style name="AppThemeLogin.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>

    <style name="AppThemeRegist" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary2</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark2</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
    <style name="AppThemeRegist.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
    <style name="AppThemeRegist.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>

</resources>

color.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#d60064</color>
    <color name="colorPrimaryDark">#b30d4d</color>
    <color name="colorAccent">#elelel</color>
    <color name="colorText">#ffffff</color>
    <color name="colorPrimaryDark2">#106991</color>
    <color name="colorPrimary2">#1984b4</color>
</resources>

LogCat Error

Android resource compilation failed
Output:  C:\Users\Salma Khalil\Desktop\old Android files\App\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:193: error: invalid color.

Command: C:\Users\Salma Khalil\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-alpha18-4804415-windows.jar\189ba8b8e7730e6f63f4e978782e0299\aapt2-3.2.0-alpha18-4804415-windows\aapt2.exe compile --legacy \
        -o \
        C:\Users\Salma Khalil\Desktop\old Android files\App\app\build\intermediates\res\merged\debug \
        C:\Users\Salma Khalil\Desktop\old Android files\App\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Daemon:  AAPT2 aapt2-3.2.0-alpha18-4804415-windows Daemon #0
salma khalil
  • 147
  • 1
  • 8

1 Answers1

1

Your color code is invalid "#elelel" is not a color code. change this line color code value

<color name="colorAccentdd">#elelel</color>

to or choose your color code

<color name="colorAccentdd">#EE0909</color>
Moklesur Rahman
  • 543
  • 6
  • 12