Gradle Error In Android Studio
Solution 1:
MY SOLUTION = BELOW THE LIST OF SUGGESTED SOLUTIONS
I have just recently been dealing with this issue over the past hour and "think" i have resolved my issue/problem so far...
So will post here and because of other people searching for this one....
The above error is the same one i was getting
After some searching i came across various suggestions, But the problem also seemed fairly generic of the resolutions for other people as varying..
When was i experiencing this issue???
Some times i would get this error while compiling/building a project, but it would ALWAYS appear when i was trying to "Run" the project direct to a physical test device. Also a debug & release build worked fine.
The system restart and IDE restarts did work some times but after awhile it had to be another system restart... I hate doing that, i like to restart once a day at most.. The other solutions listed below did not work for me...
The issue itself also seemed to appear around the time if me installing another usb driver for a Nexus 7 and testing with that device.
Suggested solutions from Google (from my bad short term memory)
- Restart the Android Studio IDE / Application - rarely worked
- Restart the computer itself - worked most times for a limited time
- Perform a project rebuild - error would some times occur during this
- Perform a ./gradlew clean - error would some times occur during this
- Create a new basic / blank project - same result most times
- Different Android Device - table and phone did the same results
- Restart ADB service - did not work for me
- Another Dev Computer - was to lazy to test this.. to much effort install A-S
- Delete the projects gradle folder - this messed mine up / lucky for backups ;)
- Change the gradle dependency version - "com.android.tools.build:gradle"- did not work
- Re-install gradle inside User folder - "shown in error" - same result
- Re-install Android Studio - did not attempt this (yet)
- Different version of Android Studio - did not attempt this (yet)
- And what ever else i tested quickly
Have posted the above just to give people a quick list to save them from a little google keyword refinement
AND what ended up working for me so far
Restarting the PC worked and after a little time the problem comes back, so decided to open my task manager and have a look at what was taking SYSTEM MEMORY and noticed Google Chrome was using a fair bit (as it does, but i love it)..So i shut it down along with (a hd movie, email clients and all the other usual stuff i have running) and hit the "Run" button... It worked.... Restored various backups with nothing else running.. It worked...
So for me, it was system resources! i was also able to reproduce the problem by loading down my system with plenty of applications in memory.
EDIT - Following morning
This morning when i checked the project, it would "Run" fine with no problem, a "Make project" did produce the error and doing a simple "Rebuild project" resolved this again.. Possibly left over cache or something?..
STILL always relating to system memory
Even now i still get this fault, most times closing Google chrome does it, also the pages that are loaded in the browser do not have any Java running so i dont think it is a clash there either.
HARD DRIVE / WRITE & READ SPEED
I dont think this applies at all, BUT just adding it as a consideration... If all else still fails, try relocating your project to another physical hard drive?? Not another partition..
Post a Comment for "Gradle Error In Android Studio"