Skip to content Skip to sidebar Skip to footer

Issue With Colors.xml In Android Studio 3.2.1

Following is the awkward and incomplete colors.xml I get while trying to create an Android project using Android Studio 3.2.1. The error I get is D:\AndroidStudioWorkspace\PlayCar

Solution 1:

This file is copied from <Android Studio install dir>/plugins/android/lib/templates/gradle-projects/NewAndroidModule/root/res/values/colors.xml. Check for it to find any error in this file.

For me, the content of this file is

<?xml version="1.0" encoding="utf-8"?><resources><colorname="colorPrimary">#008577</color><colorname="colorPrimaryDark">#00574B</color><colorname="colorAccent">#D81B60</color></resources>

Overwrite it if your template is modified.

Update for the updated question: I think your project template is totally overwritten with a mess. You may recursively find what the error of your templates are, by finding the source of error output of the file path (for example, the error in the update says file (D:\AndroidStudioWorkspace\GameCardz\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xml, which can be mapped into the template file <Android Studio install dir>/plugins/android/lib/templates/gradle-projects/NewAndroidModule/root/res/mipmap-anydpi-v26/ic_launcher_round.xml.), correct each of them.

Or, since this template locates in <Android Studio install dir> (actually it is a bundled plugin), you may reinstall your Android Studio, or reinstall (but, how to?) that plugin to fix this issue.

Solution 2:

In my case I had to delete .gradle .android and .androidstudio3.x folders in c\useres\username and it went normal again. I think you have updated androidstudio recently.

Solution 3:

In my case, I had to delete .gradle.android and .androidstudio3.x folders in C:\Users\username and it went normal again. I think you have updated Android Studio recently.

This worked for me also. My colors.xml and ic_launcher were corrupted somehow. I built many apps with no issue. Then this weekend I was getting build errors.

Solution 4:

If your files from <Android Studio install dir>/plugins/android/lib/templates/gradle-projects/NewAndroidModule has been crashed.

  1. Download https://android.googlesource.com/platform/tools/base/+archive/studio-master-dev/templates/gradle-projects/NewAndroidModule.tar.gz

  2. Go to <Android Studio install dir>/plugins/android/lib/templates/gradle-projects/NewAndroidModule

  3. Extract files from <Name Of Downloaded File>.tar.gz and Replace All !!!
  4. Restart Android Studio

Post a Comment for "Issue With Colors.xml In Android Studio 3.2.1"