Gradle: error: illegal unicode escape

I recently upgraded to the latest version of Android Studio (0.2.x), and I had a problem when I cannot create a project. I get an error message:

Gradle: Execution failed for task ':TestApplication:compileDebug'. 

Compilation error; see compiler error output. C: \ Users \ user \ AndroidStudioProjects \ TestApplicationProject \ TestApplication \ build \ Source \ r \ Debug \ com \ e.g. \ testapplication \ R.java

 Gradle: error: illegal unicode escape 

Now I understand that I had to reinstall Android Studio according to the instructions:

 Windows users: Do not install Android Studio 0.2.x in the same location as 0.1.x. Doing so may cause errors such as ClassCastException or other unexpected behaviors. It best if you remove your previous version of Android Studio 0.1.x. 

And I really did it, I deleted Android Studio and deleted the remaining folder (which, apparently, was not deleted after the removal), stored at: C:\Users\user\AppData\Local\Android

Then I started cleaning up the registry entries just in case (I tried this on my third attempt after I didnโ€™t get it to work) and rebooted before reinstalling.

After rebooting the computer, I started a new installation of Android Studio, it was successfully installed. I created a test project from scratch (to make sure that this is not a problem with opening previous projects), but immediately after opening the project, it already shows assembly problems. I tried to run it and it just wonโ€™t compile.

What is even more strange is that all the problematic lines according to the output of the compiler are commented out lines in R.java. Here is one:

  /** From: C:\Users\user\AndroidStudioProjects\TestApplicationProject\TestApplication\src\main\res\values\dimens.xml 

And he points to character 30 of this line, which is located on the right between u and s of the user's word (<attached image href = "https://dl.dropboxusercontent.com/u/19146514/illegal-unicode-escape.png" rel = " nofollow ">). I really tried to delete comments, but as you expect, R.java was automatically generated when I asked the project to be rebuilt.

I have absolutely no idea what the problem is, any ideas?

+4
source share
2 answers

Known issue. We have already fixed it inside. Must have it very soon (maximum a couple of days)

+5
source

I had the same problem and used a path similar to yours.

What I did was move the project to the root of drive C , so the path no longer starts with "C: \ Users \ user", and the problem is fixed ... Actually, this is not a solution, but a workaround.

PS: Actually, this is not an answer, but I still do not have enough comments, and this may help someone.

0
source

Source: https://habr.com/ru/post/1491296/


All Articles