I tried each and everything possible like updating my Android Studio, enable gradle in offline mode, in fact I reinstalled Android Studio two times at different location but nothing is working, every time getting the same error:
Error:Failed to create parent directory 'C:\Users\professional.gradle\caches\modules-2\files-2.1\com.google\google\1' when creating directory 'C:\Users\professional.gradle\caches\modules-2\files- 2.1\com.google\google\1\c35a5268151b7a1bbb77f7ee94a950f00e32db61'
The error is solved after deleting the complete activity file and XML file in it, creating a new activity and then just cleaning and rebuilding your project will resolve the error and run the app.
Related
I am getting this unexpected error and I tried re-installing the Gradle file still I am facing the same error I even tried rebuilding the project but when I create a new project it gives the same error called "Unable to load class 'com.google.common.base.Optional'.",
"This is an unexpected error. Please file a bug containing the idea.log file."
Try deleting your .gradle directories from both in home directory and at the top level of tthe project.
Questions with similar issues
Android Studio: Unable to load class 'com.google.common.base.Preconditions', Gradle Sync Failed
I was making changes in one of the xml files in my Android Studio project on Windows 10 then this after clicking Ctrl + s by mistake, it never saves the current file and then I receive this error:
Following errors occurred on attempt to save files: Cannot save blabla.xml. Unable to open the file for writing.
This window keeps appearing prior to building:
Copy content of xml, save to place outside of android
studio
Delete file from android studio
Create new file with same name
Copy saved content to new xml.
This fixed my problem invalidate/restart didn't worked.
So I have a android project which I am working on, when I try to reference and Edit Text via id "email", it show that I have an object with id "email". If i use it and then built the app it shows this error.
Error:(30, 53) error: cannot find symbol variable email
If that symbol is not there then why is it in the auto complete.
I have tried cleaning the project and rebuilding it, also tried grade sync.
So check all this and try to:- *Clean your build, then rebuild *Make
sure there are no errors or typos in your XML files *Make sure your
resource names consist of [a-z0-9.]. Capitals or symbols are not
allowed for some reason. Perform a Gradle sync (via Tools > Android
Sync Project with Gradle Files)
I have tried alot of things (restart Android Studio, PC, Invalidate Caches, Power Saver mode,...).
Finally, deleting .idea folder and all .iml files from the project, restarting Android Studio and rebuilding gradle did the trick. Autocomplete in XML support library is working again.
Probably checking out files from Version Control or copying all the source files in a new project would do the trick aswell.
Recently in my Xamarin.Forms solution, inside the Android project, I am getting the following build error:
Invalid resource directory name: "res renderers"
Doing a small amount of investigating I found the culprit inside the obj>Debug>res> folder. I tried deleting the folder and rebuilding but it seems to recreate it every time. I'm not sure why it started doing this and causing the IDE006 warning as well.
Anyone know how to remedy this? Is there a way to configure the Android project to ignore this folder?
I had the same problem and I did the two followings to solve:
try clean/build solution several times (after few times it worked for me)
exit and come back.
I hope this helps.
I had an .axml file inside my Android project that was causing the res/renderers file to be created that contained I suppose a corresponding file. Due to that creation I was getting the error but upon deleting the .axml file in my project, cleaning and rebuilding, the res/renderers folder stopped being created on build. I had that .axml file created before and not cause this error so I'm not completely convinced this is the real answer but it solved my problem and hopefully when I recreate the file it doesn't happen again. Perhaps use of a regular .xml would be better.
Suddenly this time when I created a new project is showing me error. When we create a new project in eclipse its a Hello World Project which is set up. But that is also showing error, I checked my source code that was perfect. and xml is also perfect. I can't make out where is the actual error.
I tried Clean up my project but that too dint worked. I event tried Build Automatically but that also dint worked.
I even checked my sdk path, then Right click on Project-> Properties-> Java Build Path to check whether src file is listed as a Source folder.
Following error was shown in console.
[2012-09-22 17:41:03 - Dex Loader] Unable to execute dex: wrapper was not properly loaded first
[2012-09-22 17:41:03 - HelloHi] Conversion to Dalvik format failed: Unable to execute dex: wrapper was not properly loaded first
Any help is appreciated.
Just restart the eclipse and run the project. The error arises while installing a new target version. After completion of the installation it will get fix automatically.