Help us understand the problem. What is going on with this article?

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

More than 3 years have passed since last update.

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

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

keigodasu
都内でインフラエンジニアをやっています。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした