سؤال

بعد التحديث إلى 0.4.2 يمكنني الحصول على هذا الخطأ عند فتح المشروع:'Gradle المشروع تزامن فشل.الوظائف الأساسية (على سبيل المثالتحرير التصحيح) لا تعمل proprerly'

سجل الأحداث يظهر هذا:

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.

    at org.gradle.launcher.daemon.bootstrap.DaemonGreeter.parseDaemonOutput(DaemonGreeter.java:34)
    at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startProcess(DefaultDaemonStarter.java:109)
    at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startDaemon(DefaultDaemonStarter.java:90)
    at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startDaemon(DefaultDaemonConnector.java:95)
    at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(DefaultDaemonConnector.java:72)
    at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:149)
    at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:74)
    at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:42)
    at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:30)
    at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:106)
    at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:100)
    at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:143)
    at org.gradle.tooling.internal.consumer.connection.ActionAwareConsumerConnection.run(ActionAwareConsumerConnection.java:40)
    at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter$1.run(DefaultBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:82)
    at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
    at org.gradle.tooling.internal.consumer.connection.LoggingInitializerConsumerActionExecutor.run(LoggingInitializerConsumerActionExecutor.java:44)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
2014-01-12 02:57:48,886 [  33025]   INFO - .BaseProjectImportErrorHandler - Failed to import Gradle project at 'C:/android/workspace_studio/Noggle' 
org.gradle.tooling.GradleConnectionException: Could not run build action using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.9-all.zip'.
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:55)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
    at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:43)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:170)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$000(GradleProjectResolver.java:61)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$1.fun(GradleProjectResolver.java:117)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$1.fun(GradleProjectResolver.java:113)
    at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:182)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:113)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:61)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:471)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:549)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:464)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:373)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:436)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:153)
Caused by: org.gradle.api.GradleException: Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/1.9/userguide/gradle_daemon.html
Please read below process output to find out more:
-----------------------
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.

    at org.gradle.launcher.daemon.bootstrap.DaemonGreeter.parseDaemonOutput(DaemonGreeter.java:34)
    at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startProcess(DefaultDaemonStarter.java:109)
    at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startDaemon(DefaultDaemonStarter.java:90)
    at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startDaemon(DefaultDaemonConnector.java:95)
    at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(DefaultDaemonConnector.java:72)
    at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:149)
    at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:74)
    at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:42)
    at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:30)
    at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:106)
    at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:100)
    at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:143)
    at org.gradle.tooling.internal.consumer.connection.ActionAwareConsumerConnection.run(ActionAwareConsumerConnection.java:40)
    at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter$1.run(DefaultBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:82)
    at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
    at org.gradle.tooling.internal.consumer.connection.LoggingInitializerConsumerActionExecutor.run(LoggingInitializerConsumerActionExecutor.java:44)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
    at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
2014-01-12 02:57:48,893 [  33032]   WARN - nal.AbstractExternalSystemTask - A fatal exception has occurred. Program will exit.

com.intellij.openapi.externalSystem.model.ExternalSystemException: A fatal exception has occurred. Program will exit.

    at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:185)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:113)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:61)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:471)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:549)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:464)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:373)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:436)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:153)

2014-01-12 02:57:48,895 [  33034]   WARN - .project.GradleProjectImporter -  
2014-01-12 02:57:48,895 [  33034]   INFO - .project.GradleProjectImporter - A fatal exception has occurred. Program will exit.


Consult IDE log for more details (Help | Show Log) 
2014-01-12 02:57:48,941 [  33080]   INFO - ution.rmi.RemoteProcessSupport - Port/ID: 21325/Maven3ServerImpl5ed05101 
2014-01-12 02:57:49,424 [  33563]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/remote-servers.xml file is null 
2014-01-12 02:57:50,185 [  34324]   INFO - tor.impl.FileEditorManagerImpl - Project opening took 13482 ms 

الإصدار 0.4.1 كان يتصرف بشكل جيد للغاية بالنسبة لي.

هل كانت مفيدة؟

المحلول

أنا أفترض أنني أستطيع الإجابة على سؤالي .... هذا عملت بالنسبة لي.

  1. file -> caches / إعادة إبطال / إعادة التشغيل
  2. اغلاق الروبوت الاستوديو
  3. إعادة تسمية / إزالة مجلد .gradle في دليل المستخدم الرئيسية
  4. إعادة تشغيل Android Studio دعه يقوم بتنزيل جميع الأشياء المتقدمة التي تحتاجها
  5. نجاح بناء النجاح!
  6. rebuild project .... النجاح!
  7. خارج الفضولي، قارنت هيكل .gradle القديم والآخر ... كانوا مختلفين جدا!

    لذلك سأرى كيف يذهب 0.4.2 :)

نصائح أخرى

كان عندي نفس المشكلة ولكن في النهاية لا يمكن حلها إلى الأبد
الخطوات:

  1. حذف gradle و .gradle والمجلدات من مجلد المشروع الخاص بك.
  2. في Android Studio:فتح المشروع ثم: ملف -> إعدادات -> مترجم -> gradle:تمكين offline mode
    ملاحظة:في أحدث نسبيا الروبوت استوديوهات ، وضع غير متصل بالشبكة وقد تم نقله إلى gradle الإعداد. enter image description here
  3. إغلاق المشروع الخاص بك: ملف> إغلاق المشروع
  4. الاتصال بالإنترنت و فتح المشروع مرة أخرى ثم السماح Android Studio تنزيل ما تريد

إذا كان النجاح ثم :)
آخر

  1. إذا كنت تواجه gradle project sync failed مرة أخرى من فضلك اتبع الخطوات التالية:
  2. تحميل أحدث gradle حزمة من هذا الدليل
  3. استخراج ووضعها في مكان ما (على سبيل المثال f:\gradle-1.10)
  4. اذهب إلى ستوديو الروبوت وتحميل المشروع الخاص بك ثم فتح ملف->إعدادات->gradle, في هذه الصفحة اضغط على Use local gradle distribution
  5. اكتب gradle عنوان المجلد هناك
    enter image description here

تهنئة كنت فعلت!

نفسه هنا، تحديث إلى 0.4.2 كسر أيضا كل شيء في حالتي ... ليس له علاقة باستخدام الذاكرة: لقد حصلت على 8 أزعج من الذاكرة ولدي 3.5 أزعج أجهزة الصراف الآلي المجانية، لذلك لا تحتوي على ذاكرة كافية لبدء تشغيل JVM ...

في الواقع قد يكون له ما يجب القيام به مع إصدارات الخرج، نظرت إلى سجل الخطأ ووجد هذا:

2014-01-14 09: 00: 30،918 [61112] تحذير - nal.abstractexernalsystemtask - مشروع يستخدم نسخة قديمة من المكونات الروبوت المتدرج. الإصدار الأدنى المدعوم هو 0.7.0. يرجى تحديث نسخة التبعية "com.android.tools.build:gradle" في ملفات Build.Gradle الخاصة بك.

أنت تستخدم MARDLE الإصدار 1.8، وهو غير مدعوم. الرجاء استخدام الإصدار 1.9. يرجى الإشارة إلى نسخة متدرجة مدعومة في إعدادات المتدرج في المشروع أو في المجمع المتدرج للمشروع (إذا ملائم.) com.intellij.openapi.externalsystem.model.externalsystemException: يستخدم المشروع نسخة قديمة من Android Madle Plug-in. ال الحد الأدنى للإصدار المدعوم هو 0.7.0. يرجى تحديث نسخة التبعية 'com.android.tools.built:gradle' في ملفاتكم في build.gradle

-

أنت تستخدم MARDLE الإصدار 1.8، وهو غير مدعوم. الرجاء استخدام الإصدار 1.9.

يرجى الإشارة إلى نسخة متدرجة مدعومة في متدرج المشروع الإعدادات أو في مجمع المتدرج للمشروع (إن وجد.)

حسنا، لقد قمت بإصلاحها بنفسي ... في دليل المشروع، اذهب إلى / دليل الخرج / المجمع وتحرير ملف خصائص المجمع المتدرج إلى هذا:

giveacodicetagpre.

بعد افتح مشروعك في Android Studio وحدد ملف Build.Gradle في دليل / SRC وتعديله إلى هذا:

giveacodicetagpre.

بعد إصلاحه مثل هذا اكتشفت هذه المقالة: http://tools.android.com/recent/AndroidStudio040Relome

  1. فتح الملفات -> الإعدادات
  2. اختيار الخرج
  3. مارك "استخدم توزيع العجمات المحلي" واختر مسار Grandle Home بالنسبة إلى السابقين: ج: /users/high_hopes/.gradle/wrapper/dists/gradle-2.1-all/27drb4udbjf4k88eh2ffdc0n55/gradle-2.1.1.1.1.1.1.1.1 ثم اختر مسار دليل الخدمة C: /users/high_hopes/.gradle
  4. تطبيق جميع التغييرات
  5. فتح الملفات-> مخططات التخزين المؤقت / إعادة التشغيل ...
  6. حدد فقط إعادة تشغيل

بعد الإبلاغ عن مشكلة في موقع ردود الفعل Android Studio، وجدوا حلا بالنسبة لي.أنا الآن باستخدام Gradle 1.10 و Android Studio 0.4.3.

هنا هو الرابط إلى الصفحة مع وصف لكيفية إصلاح الألغام: https:/code.google.com/p/android/issues/detailمعرف= 65219

آمل أن يساعد هذا!

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/

I am facing this problem many times from last few days, the answer above works perfectly fine. I was looking for the exact reason for this problem and in my case I found slow internet or no internet on your machine(assuming you are taking project to windows from mac, that may not be required).

I've noticed while doing build it stopped fetching a URL(http://.maven.org/). I don't know why android studio doing these things again, but that seems to be the only problem in my case.

For those who are upgrading to v1.0 of Android Studio and see the error Gradle DSL method not found: 'runProguard', If you are using version 0.14.0 or higher of the gradle plugin, you should replace "runProguard" with "minifyEnabled" in your build.gradle files. i.e.

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}

After following Carlos steps I ended up deleting the

C:\Users\MyPath.AndroidStudioPreview Directory

Then re imported the project it seemed to fix my issue completely for the meanwhile, And speedup my AndroidStudio

Hope it helps anyone

I have Android Studio 0.8.9 and after hours on forums the thing that finally worked for me was to manually download Gradle (latest version) then go to: C:\Users\.gradle\wrapper\dists\gradle-1.12-all\\ and replace the local archive with the recently downloaded archive and also replace the extracted data; after restarting Android Studio... he did some downloadings and builds and all sorts of stuff, but it finally worked.. Good Luck people!

This is what worked for me with Android Studio 1.0.2:

File -> Settings-> Gradle Set 'Use default Gradle wrapper.'

The other methods didn't seem to work for me.

I'm not using Android Studio, but had same problem. I had to update the latest java jdk and set the JAVA_HOME to that jdk.

I had the same error. I deleted the android repository from android sdk manager and reinstalled it. It worked.

Load Project:>Build, execution, Deployment:>(Check on)compiler Independent modules in parllel.

Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.

seems fairly clear-cut: your OS can't find enough RAM to start a new Java process, which is in this case the Gradle builder. Perhaps you don't have enough RAM, or not enough swap, or you have too many other memory-hungry processes running at the same time.

I had this problem when I started my project and there was not enough RAM for gradle. I searched a solution for an hour including the variants given above, but then I just closed my browser and rebooted my IDE. Interesting that if you run browser or a game after successful starting IDE and project it still works properly. Hope this solution will be useful for somebody. p.s. sorry for my English knowledge (it`s from school).

All you have to do is remove .gradle from user, paste, and verify update in Android Studio and it will work perfectly!

I always remove the .gradle folder from %USERS% folder and start the studio again. When starting the IDE it downloads gradle again with all the dependencies again. Its work PERFECT.

Today I ran into the same error, however, i was using Android Studio 1.0.2. What i did tot fix the problem was that i started a project with minimum SDK 4.4 (API 19) so when i checked the version i noticed that at File->ProjectStructure->app i found Android 5 as a compile SDK Version. I changed that back to 4.4.

I was seeing this error along with: "Error:compileSdkVersion android-21 requires compiling with JDK 7"

For me, the solution was found here, where I had to update the JDK location in the project structure.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top