Skip to content
Home » Suppressed: java.lang.Exception: Could not close incremental caches in Flutter

Suppressed: java.lang.Exception: Could not close incremental caches in Flutter

In this article , I will discuss about a warning Suppressed: java.lang.Exception: Could not close incremental caches in Flutter .

Recently , I have upgrade my flutter version and the dependencies used in my app . In older version my app builds without any warning . In the new version also app builds successfully but with a ton of this warning for every dependency . You can see below the warning for wakelock_plus dependency .

 Suppressed: java.lang.Exception: Could not close incremental caches in D:\coderassists\projects\test1\build\wakelock_plus\kotlin\compileReleaseKotlin\cacheable\caches-jvm\inputs: source-to-output.tab
                ... 25 more
                Suppressed: java.lang.IllegalArgumentException: this and base files have different roots: C:\Users\bhatt\AppData\Local\Pub\Cache\hosted\pub.dev\wakelock_plus-1.3.3\android\src\main\kotlin\dev\fluttercommunity\plus\wakelock\Wakelock.kt and D:\coderassists\projects\test1\android.
                        at kotlin.io.FilesKt__UtilsKt.toRelativeString(Utils.kt:117)
                        at kotlin.io.FilesKt__UtilsKt.relativeTo(Utils.kt:128)

To hide this warning add the below line in “android/gradle.properties” file

kotlin.incremental=false

then run :

flutter clean
flutter pub get

Then build the apk , you will not see these warnings .

If you like this article , please like , comment and share the article . You can also buy me a coffee.

Leave a Reply

Your email address will not be published. Required fields are marked *