我已经安装了android studio 3.1.3版本,在编写了一些代码后我遇到了一些错误,为了解决该错误,我将Gradle版本从4.4升级到4.6,将Android插件版本从3.1.3升级到了3.2.0- alpha18。它解决了该旧错误,但收到了新错误。我在屏幕截图中显示了完整的错误。
错误:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
请帮助我解决这个问题。
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错误
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
答案 0 :(得分:1)
您的颜色代码无效“ #elelel”不是颜色代码。 更改此行的颜色代码值
=IF((REGEXMATCH(JOIN("", B5:B6, B8:B9), "☑"))*
((B2+7) < TODAY() ), "On Time", "Running Behind")
选择或选择您的颜色代码
<color name="colorAccentdd">#elelel</color>