Gradle: error: illegal unicode escape - android

I recently updated to the most recent Android Studio version (0.2.x), and I am experiencing an issue where I cannot build the project. I receive an error message stating:
Gradle: Execution failed for task ':TestApplication:compileDebug'.
Compilation failed; see the compiler error output for details. C:\Users\user\AndroidStudioProjects\TestApplicationProject\TestApplication\build\source\r\debug\com\example\testapplication\R.java
Gradle: error: illegal unicode escape
Now, I understand I was supposed to reinstall Android Studio as per 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's best if you remove your previous version of Android Studio 0.1.x.
And I actually did, I uninstalled Android Studio, and deleted the remaining folder (Which is apparently not deleted after uninstall) stored at: C:\Users\user\AppData\Local\Android
I then proceeded to clean the registry entry just in case (I tried this on my 3rd attempt after not getting it to work), and rebooted before re-installing.
After the PC rebooted, I proceeded to do a fresh install of Android Studio, it installed successfully. I created a Test Project from scratch (to make sure it was not a problem with opening previous projects), but right after it opened the project it's already showing the build problems. I tried running it and it simply won't compile.
What's even more strange is that all of the problematic lines according to the compiler output are commented lines in the R.java. Here's one:
/** From: C:\Users\user\AndroidStudioProjects\TestApplicationProject\TestApplication\src\main\res\values\dimens.xml
And it points to the character 30 of that line, which is right between the u and the s of the word user (image attached). I actually tried deleting the comments, but as you'd expect the R.java was generated automatically when I asked for the project to be rebuilt.
I have absolutely no clue what the problem is, any ideas?

Known issue. We have fixed it internally already. Should have it out very soon (couple of days max)

I had the same problem and I was using a path similar to yours.
What I did was move the project to the root of the C drive, so the path doesn't start with "C:\Users\user" anymore and the problem is avoided... Not really a solution, but a workaround.
PS: This is not really an answer, but I don't have enough points to comment yet and this might help someone.

Related

Can not Clean Project on Android Studio

When tried to clean the project using options provided by Android Studio IDE. I get following errors.
Errors occurred during the build. Errors running builder 'Android
Package Builder' on project 'appcompat_v7'. Problems encountered while
deleting resources. Could not delete 'C:\Users\Felix Manford
Esq\Documents\Workspace\Ghtourwall\appcompat_v7\bin\appcompat_v7.jar'.
Problems encountered while deleting files. Could not delete:
C:\Users\Felix Manford
Esq\Documents\Workspace\Ghtourwall\appcompat_v7\bin\appcompat_v7.jar.
Problems encountered while deleting resources. Could not delete
'C:\Users\Felix Manford
Esq\Documents\Workspace\Ghtourwall\appcompat_v7\bin\appcompat_v7.jar'.
Problems encountered while deleting files. Could not delete:
C:\Users\Felix Manford
Esq\Documents\Workspace\Ghtourwall\appcompat_v7\bin\appcompat_v7.jar.
I observed it was right after i set up my image button; which i don't get because i did everything correctly.
I observed it was right after i set up my image button; which i don't
get cos i did everything correctly
No This is not due to this issue. The error is not a syntax issue, It is a development environment's Build issue.
There are several things that you can do to kill the process that prevents the cleaning of the application to work.
Close the IDE and then start it again. This will kill the currently running Gradle build tasks. which will prevent these jar files being deleted during the clean up.
You can invalidate the IDE using the following option,
Even if that is not working, You can kill all the JVM processes that runs on your computer using the task manager,
If that does not solve the issue, You can try restarting the computer as last resort.
I do not expect that you get to this one. But If any of these things did not work, then there is something wrong with your IDE or JVM, Try to reinstall IDE and see,

Android Studio stuck while building application

I recently switched from Eclipse to Android Studio because I read that it is now the official IDE for Android application development. I downloaded and installed the latest version (1.0.2) for Windows. When using the program for the first time, I decided to create a test application to see if the program was working correctly. Unfortunately, it was not. Once I clicked the finish button to complete the New Project Wizard, A loading bar showed up that said Gradle: Build. This is where the program gets stuck. There is no error message and it appears that the program is running fine, however the build never actually completes. I am never given my MainActivity.Java class, or my activitymain.xml document. If I click the cancel button, the program freezes and I have to use the TaskManager to kill the program. If I re-enter the program and choose to open an existing project, my project will be there. However, upon trying to open the project, I am greeted with the same Gradle: Build loading bar.. I have been searching for an answer for the last 3 days and nothing has worked. Any help is greatly appreciated!
Things I have tried:
Simply letting the program sit for a while to see if it was actually downloading something and was just really slow. I let it sit for 45+ minutes before killing the program.
Uninstalling and re-installing Android Studio
Restarting my computer
Turning off my firewall (Kaspersky)
Running the program as an administrator
Connecting to a different network
Disconnecting my computer from any networks (to force the program to build in offline mode)
Manually downloading Gradle from the link that Android Studio attempts to use when it gets stuck and telling the program to use that file instead of downloading another one.
(I went to this link https://services.gradle.org/distributions/gradle-2.2.1-all.zip, downloaded the file, unzipped it, went to Gradle settings in Android Studio, checked the Offline work checkbox, and finally set the service directory path to my unzipped Gradle folder.)
Hopefully I have given enough information and made it clear what my problem is. If not please tell me what else I need to explain so I can get this issue resolved. Thanks!
Please note I am working on a 64 bit machine running Windows 8. Also, I use studio64.exe
to run the program.
From the discussion we had in the comments, it does not look like you have your gradle on your windows path.
Please change the below to point to your gradle install:
set GRADLE_HOME=C:\<installation location>\gradle-1.11
set PATH=%PATH%;%GRADLE_HOME%\bin
After this, verify that in the terminal running the following works:
gradle tasks
once you get this working, you will want to run the following in your project:
gradle wrapper
This will produce a .bat file which you can then use to run gradle through the wrapper, letting you support multiple native gradle installations.

Can´t Run or Export Android Application after incorporting Facebook sdk to my project

I don´t know what I did... Everything was working well, had to battle a while to get facebook login working, and doing what I wanted to do... Finally it was ready, so I proceeded to Export Android Application... First error had to do with Dalvik code error 1 something... So I look for duplicates .jars in my folder, erased libraries in java build path, cleaned the project, etc, as proposed in some stackoverflow answers...
Stopped getting that kind of error but now I can´t even Run the application, now I get some errors like: Unable to execute dex: GC overhead limit exceeded, or: Unable to execute dex: Java Heap Space.
In my windows machine it gets stuck until some memory related error is displayed... in my Mac the Eclipse is forceclosed in most occasions ... I tried to roll back and took off the facebook sdk part, but nothing, now I can´t run/export my app even as it was before... I guess I did something wrong in the cleaning or something in the Eclipse parameters..
Please help, I´m dying here.. Thanks.
Answering myself to help others:
1.Check there´s no duplicate .jar anywhere in your project.
2.Go to eclipse.ini in your Eclipse folder, and modify to this, or greater:
-Xms512m
-Xmx1024m
3.Save and restart Eclipse
4.Go to Project -> uncheck Build Automatically
5.Go to Project -> Clean... , clean both the library project and your app project
6.Export your app as a signed APK while Build Automatically is still disabled
7.Re-enable Build Automatically and everything should be back to normal as before

android studio build error debug-unaligned.apk path not found

Last night I updated my android studio to 0.5.3 and since than i am getting this error message whenever I am trying to generate a signed-apk. It does not occur when I am just running the project over android studio.
I tried rebuilding, cleaning project, restarting android-studio, reimporting the project, no success. I am pretty desperate right now
EDIT: i found out that actually debug-unaligned is not generated... But why is that? And why do i need to generate it if i am just trying to sign the app
In 0.5.3, we tried to speed up the build process by not having it do a full build to an APK except when it needs to, but we missed some cases where it needs to.
You can follow progress in https://code.google.com/p/android/issues/detail?id=67948 but in the meantime you can work around it by running the assembleRelease task, either from the command line or from the Gradle tasks view:

Android: Eclipse won't run Android projects

I have an issue where every time I try to run a project (that has normally run before), eclipse tells me I have compile errors. There are no errors in the code, the console is empty and I haven't changed anything in the build path...recently. I can actually export the application and install it on the phone and it runs fine, but playing from Eclipse if broken for some reason. I wish I could give more info, but there is nothing to show :/
EDIT: I can't even run a new project. I just tried to make a Hello World app and it still says I have compilation errors. I don't know if this might help so I figured I would add it.
EDIT 2: Problems tab stats this: "Description Resource Path Location Type Error generating final archive: Debug Certificate expired on 3/30/12 10:10 AM TestApp Unknown Android Packaging Problem."
FIXED: debug.keystore issue fixer upper
Help?
Go to window --> preferences --> Android --> build, see where Eclipse points to your debug.keystore, go there delete it, and relaunch Eclipse.

Categories

Resources