In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again. For finding your .
Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.
I'm assuming I can answer my own question.... This worked for me.
Out of curiousity I compared the structure of the old .gradle and the new one... they were pretty different !
So I'll see how 0.4.2 goes :)
I had same problem but finally I could solve it forever
Steps:
gradle
and .gradle
folders from your project folder. offline mode
If success then :)
else
gradle project sync failed
again please follow these steps: Use local gradle distribution
Congratulation you are done!
same here, updating to 0.4.2 also broke everything in my case... It has nothing to do with memory usage : I've got 8 gig of memory and I have 3.5 gig free atm, so not having enough memory to start up a JVM is bullocks...
Actually it might have something to do with Gradle versions, I looked into the error log and found this :
2014-01-14 09:00:30,918 [ 61112] WARN - nal.AbstractExternalSystemTask - Project is using an old version of the Android Gradle plug-in. The minimum supported version is 0.7.0. Please update the version of the dependency 'com.android.tools.build:gradle' in your build.gradle files.
You are using Gradle version 1.8, which is not supported. Please use version 1.9. Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.) com.intellij.openapi.externalSystem.model.ExternalSystemException: Project is using an old version of the Android Gradle plug-in. The minimum supported version is 0.7.0. Please update the version of the dependency 'com.android.tools.build:gradle' in your build.gradle files
-
You are using Gradle version 1.8, which is not supported. Please use version 1.9.
Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)
OK, I fixed it myself... In the project directory go to /gradle/wrapper directory and edit the gradle-wrapper properties file to this :
distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-all.zip
After open your project in Android Studio and select the build.gradle file in the /src directory and edit it to this :
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
After fixing it like this I discovered this article : http://tools.android.com/recent/androidstudio040released
After reporting the problem on the Android Studio feedback site, they found a solution for me. I am now using Gradle 1.10 and Android Studio 0.4.3.
Here is the link to the page with a description of how I fixed mine: https://code.google.com/p/android/issues/detail?id=65219
Hope this helps!
I found one answer on the net and it worked for me, thus here it is:
When you get the gradle project sync failed error, with error details:
Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
Then, on Windows, please go to:
Control Panel > System > Advanced(tab) > Environment Variables > System Variables > New:
Variable name _JAVA_OPTIONS
and Variable value -Xmx512M
Save it, restart AS. It might work this time, as it did for me.
Source: http://www.savinoordine.com/android-studio-gradle-windows-7/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With