android.dexOptions.incremental property is deprecated

AndroidAndroid StudioAndroid Gradle-Plugin

Android Problem Overview


When trying to run gradle build, I get following warning in Android Studio 2.2 :

Warning:The android.dexOptions.incremental property is deprecated and it has no effect on the build process.

enter image description here

In build.gradle file here I have declare dexOptions

dexOptions {
   incremental true
   jumboMode = true
}

If it is deprecated then what is the alternate option of this attribute.

Android Solutions


Solution 1 - Android

By default incremental is turned on Java compilation in 2.1.0-rc1 (2016/4/22) or later. So its redundant to declare it in build.gradle file.

Solution 2 - Android

Changes in Gradle 2.1.0-rc1 (2016/4/22) or later.

1. Remove deprecated dexOptions.incremental. Incremental Java compilation is ON by default.

2. No need to write jumboMode too, Jumbo mode is ON by default in instant-run mode.

First stable v2.1.0 (2016/4/26)

Visit official gradle site for more details

Edit: 27/01/2017

Instant Run changes

Android Studio 2.3 Canary 3 and newer has change to how Instant Run works.

Applying changes to a running applications is no longer tied to the play.png Run button. The Run button will now always perform an application restart. To apply code and resource changes in the running process, there is a new hot-reload.png button right next to it, "Apply Changes", which attempts to hotswap the changes into the app. -> ref

So that jumboMode may not effect from run button. thanks

toolbar

Solution 3 - Android

Solve Problem after removing deprecated

dexOptions { incremental true }

Incremental Java compilation is ON by default.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBiswajit KarmakarView Question on Stackoverflow
Solution 1 - Androiduser779370View Answer on Stackoverflow
Solution 2 - AndroidQamarView Answer on Stackoverflow
Solution 3 - AndroidTarsbir SinghView Answer on Stackoverflow