0

This is a first time that I used Android Studio. I configure all set up as per instruction and also do the downloads of gradle. But when I try to build my project gradle sync get failed and gives me this error "Gradle 'MyApplication' project refresh failed: A fatal exception has occurred. Program will exit."

I google a lot for this issue and as per other developer comments I try this solutions, restart my system & studio also delete/rename .gradle folder & do downloading again but still my issue is as it is.

The one interesting thing is happening with me is some times after lots of restart & changing network settings it runs my project (means no any issue), but when I restart Android studio in working condition then same error has occurred again & I am not able to do any thing.

I try Android Studio 0.5.3 as well as 0.5.4 with gradle-1.10.

So I request you if any one know this issue then please let me know.

Thanks in advanced.

Amol Wadekar
  • 886
  • 2
  • 14
  • 28

1 Answers1

0

Only this solutions is work for Android Gradle Issue

As per solution gradle need more heap size than default one. I set Android studio VM parameter as like below and then all thing are get working properly.

Set File -> Settings -> Compiler -> Java Compiler -> Additional command line parameters

-Xms256m -Xmx512m

File -> Settings -> Compiler -> Gradle -> VM Options

-XX:MaxHeapSize=256m -Xmx256m

Then restart Android Studio and everything should be fine.

Community
  • 1
  • 1
Amol Wadekar
  • 886
  • 2
  • 14
  • 28