Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
17
Help us understand the problem. What is going on with this article?
@keigodasu

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

More than 5 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

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

17
Help us understand the problem. What is going on with this article?
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
keigodasu
都内でインフラエンジニアをやっています。
future
ITを武器とした課題解決型のコンサルティングサービスを提供します

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
17
Help us understand the problem. What is going on with this article?