question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Annotation Processor support for Kapt in Android

See original GitHub issue

I would like to know what is the correct procedure to enable Annotation Processor for Immutables. I have been trying to set up it up in one of my Android projects but have been unsuccessful. I’m trying the following code in my module level Gradle file:

android {
    defaultConfig {
        kapt {
            arguments {
                arg("-Aimmutables.gradle.incremental", "true")
            }
        }
    }

dependencies {
    kapt "org.immutables:value:2.8.8"
    compileOnly "org.immutables:value:2.8.8”
    compileOnly "org.immutables:gson:2.8.8"
    }

When I build my project I get the following warnings:

warning: The following options were not recognized by any processor: '[-Aimmutables.gradle.incremental, kapt.kotlin.generated]'

[WARN] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: org.immutables.processor.ProxyProcessor (DYNAMIC).

What am I missing?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
elucashcommented, Aug 31, 2021

I don’t know syntax there (there are just too many ways to do the same, yet who knows which works) On #804 it was suggested something like this

tasks {
    compileJava {
        options.compilerArgs.add("-Aimmutables.gradle.incremental")
    }
}

Also something like this discussed here https://github.com/google/dagger/issues/1120#issuecomment-493512366 kapt.incremental.apt=true seems to be the default, so setting it in gradle.properties might have no difference

0reactions
dijgascommented, Aug 31, 2021

@elucash I’m not sure, I can’t find anything else that is required to be included. Also found this issue (#8128) which appears to be linked to warnings - perhaps the warnings are just redundant?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Android kapt and its usage? What's the difference ...
"Kapt is the Kotlin Annotation Processing Tool" you need this, to generate annotated code in compile time you can see more info in...
Read more >
Annotation Processing with Kapt and Gradle - Mark Dappollone
If you're coming from java, you might be familiar with debugging an annotation processor by running javac from the command line and then...
Read more >
A look into Kotlin KAPT for Android — Code-In Mobile
The answer is, KAPT is the official tool for doing annotation processing in Kotlin, thus the answer is always. This is as long...
Read more >
KSP: Fact or kapt?. Fast and ergonomic annotation…
While we already have annotation processors in Kotlin through kapt, the new KSP API provides promises speed and ergonomics.
Read more >
kapt: Annotation Processing for Kotlin - The JetBrains Blog
We are planning to release the initial support for JSR 269 Annotation Processing in M12, which is planned for the end of May....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found