> For the complete documentation index, see [llms.txt](https://ja.docs.monaca.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ja.docs.monaca.io/reference/power_plugins/android_build_mem.md).

# Androidビルドメモリサイズ設定

Androidアプリをビルドする際のgradleの最大メモリ使用量を設定するプラグインです。

{% hint style="info" %}
このプラグインを使用するためには、対応するプランへの加入が必要となります。詳細は、 [料金プラン ](https://ja.monaca.io/pricing.html)をご確認ください。
{% endhint %}

## サポート対象のプラットフォーム

* Cordova 10 以降

## プラグインの追加方法

1. Monaca クラウド IDE か&#x3089;**`設定 → Cordova プラグインの管理`**&#x3092;選択します。
2. *利用可能なプラグイン* 項目の `MaxMemForAndroidBuild` プラグインにカーソルを置き、`有効`ボタンをクリックします。

## ビルド時の最大メモリサイズの設定

1. プロジェクトを開き、 `config.xml` を開きます。
2. Androidのビルド処理で使用する最大メモリサイズを4096Mbにする場合、次の様にして設定します。

   ```markup
      <preference name="monaca:jvmargs" value="-Xmx4096m"/>
   ```
3. このときGradle Daemonが利用する最大メモリサイズも合わせて変更する必要あり、例えば4Gにする場合、次の様にして設定します。

   ```markup
      <preference name="monaca:env:GRADLE_OPTS" value="-Dorg.gradle.jvmargs='-Xmx4G'"/>
   ```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ja.docs.monaca.io/reference/power_plugins/android_build_mem.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
