コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android Gradle プラグイン 2.1.0(2016 年 4 月)
2.1.3(2016 年 8 月)
このアップデートには、Gradle 2.14.1 以降が必要です。Gradle 2.14.1 には、パフォーマンスの改善、新機能、重要なセキュリティ修正が含まれています。詳細については、Gradle リリースノートをご覧ください。
- 依存関係:
|
最小バージョン |
デフォルトのバージョン |
備考 |
Gradle |
2.10 |
2.10 |
詳細については、Gradle のアップデートをご覧ください。 |
SDK Build Tools |
23.0.2 |
23.0.2 |
SDK Build Tools をインストールまたは設定します。 |
- 新規:
-
- N Developer Preview、JDK 8、Jack ツールチェーンを使用した Java 8 言語機能のサポートを追加しました。詳細については、N Preview のガイドをご覧ください。
注: Instant Run は、現段階では Jack と併用できません。そのため、新しいツールチェーンの使用中は無効になります。N Preview 向けに開発していて、サポートされている Java 8 言語機能を使用する場合に限り、Jack を使用する必要があります。
- 開発中のコンパイル時間を短縮するために、増分 Java コンパイルのデフォルト サポートが追加されました。これは、ソースのうち変更された部分や再コンパイルが必要な部分だけを再コンパイルすることで行われます。この機能を無効にするには、モジュール レベルの
build.gradle
ファイルに次のコードを追加します。
Groovy
android {
...
compileOptions {
incremental false
}
}
Kotlin
android {
...
compileOptions {
incremental = false
}
}
-
個々の外部 VM プロセスではなくビルドプロセス内で dex 変換を行う、プロセス内 dex 変換のサポートを追加しました。これにより、増分ビルドが高速化されるだけでなく、フルビルドも高速化されます。Gradle デーモンの最大ヒープサイズが 2,048 MB 以上に設定されたプロジェクトでは、この機能がデフォルトで有効になります。そのためには、プロジェクトの gradle.properties
ファイルに次の行を追加します。
```none
org.gradle.jvmargs = -Xmx2048m
```
モジュール レベルの build.gradle
ファイルで javaMaxHeapSize
の値を定義した場合、org.gradle.jvmargs
を javaMaxHeapSize
+ 1,024 MB の値に設定する必要があります。たとえば、javaMaxHeapSize
を「2048m」に設定した場合、プロジェクトの gradle.properties
ファイルに次の行を追加する必要があります。
```none
org.gradle.jvmargs = -Xmx3072m
```
プロセス内 dex 変換を無効にするには、モジュール レベルの build.gradle
ファイルに次のコードを追加します。
Groovy
android {
...
dexOptions {
dexInProcess false
}
}
Kotlin
android {
...
dexOptions {
dexInProcess = false
}
}
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-08-27 UTC。
[null,null,["最終更新日 2025-08-27 UTC。"],[],[],null,["\u003cbr /\u003e\n\nAndroid Gradle Plugin 2.1.0 (April 2016)\n\n\u003cbr /\u003e\n\n\n**2.1.3 (August 2016)**\n\nThis update requires Gradle 2.14.1 and higher. Gradle 2.14.1 includes\nperformance improvements, new features, and an important [security fix](https://docs.gradle.org/2.14/release-notes#local-privilege-escalation-when-using-the-daemon). For more details, see the\n[Gradle release notes](https://docs.gradle.org/2.14.1/release-notes).\n\nDependencies:\nNew:\n:\n - Added support for the N Developer Preview, JDK 8, and [Java 8 language features](/preview/j8-jack) using the Jack toolchain. To find out more, read the [N Preview guide](/about/versions/nougat).\n\n\n **Note:** [Instant\n Run](/tools/building/building-studio#instant-run) does not currently work with Jack and will be disabled while\n using the new toolchain. You only need to use Jack if you are developing\n for the N Preview and want to use the supported Java 8 language features.\n - Added default support for incremental Java compilation to reduce compilation time during development. It does this by only recompiling portions of the source that have changed or need to be recompiled. To disable this feature, add the following code to your module-level `build.gradle` file: \n\n Groovy \n\n ```groovy\n android {\n ...\n compileOptions {\n incremental false\n }\n }\n ```\n\n Kotlin \n\n ```kotlin\n android {\n ...\n compileOptions {\n incremental = false\n }\n }\n ```\n -\n Added support for dexing-in-process which performs dexing within the build\n process rather than in a separate, external VM processes. This not only makes\n incremental builds faster, but also speeds up full builds. The feature is\n enabled by default for projects that have set the Gradle daemon's maximum heap\n size to at least 2048 MB. You can do this by including the following in your\n project's `gradle.properties` file:\n\n \\`\\`\\`none org.gradle.jvmargs = -Xmx2048m \\`\\`\\`\n\n\n If you have defined a value for [`javaMaxHeapSize`](https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.DexOptions.html#com.android.build.gradle.internal.dsl.DexOptions:javaMaxHeapSize) in your module-level `build.gradle`\n file, you need to set `org.gradle.jvmargs` to the value of\n `javaMaxHeapSize` + 1024 MB. For example, if you have set\n `javaMaxHeapSize` to \"2048m\", you need to add the following to your\n project's `gradle.properties` file:\n \\`\\`\\`none org.gradle.jvmargs = -Xmx3072m \\`\\`\\`\n\n\n To disable dexing-in-process, add the following code to your module-level `build.gradle` file: \n\n Groovy \n\n ```groovy\n android {\n ...\n dexOptions {\n dexInProcess false\n }\n }\n ```\n\n Kotlin \n\n ```kotlin\n android {\n ...\n dexOptions {\n dexInProcess = false\n }\n }\n ```"]]