incremental annotation processing
warning messages
Java development
annotation processors
software troubleshooting

How to get rid of Incremental annotation processing requested warning?

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

Introduction

This warning usually means your Gradle build is configured to use incremental annotation processing, but one or more annotation processors in the build do not declare incremental support. The fix is not just "turn on a flag". You need to identify the processor that breaks incremental mode, then either upgrade it, replace it, or mark your own processor correctly.

What Incremental Annotation Processing Means

Annotation processing runs during compilation to generate code or metadata. Incremental processing lets the build reprocess only the changed sources instead of falling back to broader recompilation.

That matters because annotation processing can dominate build time in large Java or Kotlin projects.

When Gradle says incremental processing was requested but disabled, it is telling you:

  • the build wanted incremental behavior
  • at least one processor could not participate safely
  • Gradle fell back to a less efficient path

Start by Identifying the Offending Processor

Look at the build log carefully. Gradle often names the processor that prevented incremental behavior.

You can also inspect your dependencies and processors manually. Common culprits are older versions of code-generation libraries that predate incremental support.

Typical examples include processors used by:

  • dependency injection frameworks
  • ORM code generation
  • view binding or code generation tools
  • custom in-house processors

Upgrading the Processor Is the Best Fix

If the warning comes from a third-party processor, the best fix is usually to upgrade to a version that supports incremental processing.

Example Gradle dependency update:

gradle
1dependencies {
2    implementation "com.google.dagger:dagger:2.51"
3    annotationProcessor "com.google.dagger:dagger-compiler:2.51"
4}

The exact version depends on your project, but the principle is stable: incremental support is implemented by the processor, not by a magical global Gradle switch.

Flags Alone Do Not Solve It

Projects often have settings such as:

properties
kapt.incremental.apt=true

or Java annotation-processing flags that request incremental mode. Those flags are necessary only when the processors themselves support the feature. If one processor does not, the warning remains and Gradle falls back.

So the workflow is:

  1. request incremental mode
  2. ensure every participating processor supports it
  3. remove or replace processors that do not

If the Processor Is Yours

If you maintain the annotation processor, you need to declare its incremental type using Gradle metadata.

Create:

text
META-INF/gradle/incremental.annotation.processors

Example contents:

text
com.example.MyProcessor,isolating

Possible categories are commonly isolating or aggregating, depending on how the processor behaves.

That metadata tells Gradle how safe incremental recompilation is for your processor.

Kotlin and KAPT Considerations

Kotlin projects often encounter this warning through kapt. The same root cause applies: a processor used through KAPT does not support incremental mode properly.

Example setup:

gradle
1plugins {
2    id "org.jetbrains.kotlin.jvm" version "2.0.21"
3    id "org.jetbrains.kotlin.kapt" version "2.0.21"
4}
5
6kapt {
7    correctErrorTypes = true
8}

This configuration can still show the warning if the underlying processor is non-incremental. Configuration alone is not enough.

When You Cannot Fix the Processor

Sometimes the processor is old, unsupported, or internal but too risky to change immediately. In that case, the honest answer is that you may not be able to eliminate the warning yet.

Your choices are usually:

  • accept slower builds temporarily
  • replace the processor
  • isolate the module that uses it
  • upgrade or rewrite the processor later

Trying to hide the warning without changing the actual processor support just postpones the problem.

Practical Debugging Checklist

Use this order:

  1. read the warning text fully
  2. identify the named processor
  3. check whether a newer version supports incremental mode
  4. confirm your build still requests incremental processing
  5. if it is your processor, add the Gradle metadata declaration

This avoids wasting time toggling unrelated build settings.

Common Pitfalls

The most common mistake is assuming the warning can be fixed purely with a Gradle property. Another is upgrading one runtime library but forgetting the matching annotation processor artifact. Teams also sometimes ignore the warning for months and then wonder why large modules compile slowly. Finally, custom processors are often written without the metadata that Gradle needs to reason about incremental safety, so even correct processors can miss out on the optimization if they are not declared properly.

Summary

  • The warning means at least one annotation processor does not support incremental processing correctly.
  • The best fix is to identify and upgrade or replace the offending processor.
  • Build flags can request incremental mode, but they cannot force unsupported processors to become incremental.
  • Custom processors need Gradle incremental metadata to participate properly.
  • If the processor cannot be fixed yet, accept the warning honestly or isolate its impact.

Related reading
Course
Intermediate
27 lessons
14 hours
OOD Fundamentals

Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

All Rights Reserved.