19
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Android StudioでビルドしたらGradleが「Could not reserve enough space for object heap」と嘆きだした時の設定箇所

Last updated at Posted at 2015-06-23

AndroidStudioを利用していて、ビルドする際に以下のようなエラーが発生した場合の対象方法です。

Error: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/2.2.1/userguide/gradle_daemon.html
Please read the following 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.

太字箇所の通り、GradleのJavaヒープサイズが確保できたいないためにエラーとなっています。
AndroidStudioから直接gradle.propertiesを編集できるので、ここでヒープサイズを調整します。

Project>Gradle Scripts>gradle.properties

# JVM起動オプションの設定
org.gradle.jvmargs=-Xms512m -Xmx1024m

キャプチャ.PNG

その他の起動オプションもスペース区切りで指定することが可能です。

19
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?