Questions tagged [kapt]

Use this tag for questions about the kapt (Kotlin Annotation Processing) compiler plugin for annotation processing with Kotlin.

From Kotlin reference:

Annotation processors (see JSR 269) are supported in Kotlin with the kapt compiler plugin.

Being short, you can use libraries such as Dagger or Data Binding in your Kotlin projects.

282 questions
0
votes
1 answer

How to fake multi pass for kapt annotations

I have a few annotations I've written for a project. Unfortunately some of the annotations depend on code generated by another annotation of mine. Ironically after all the annotations run the code complies except for the kapt3 stubs... cuz unknown…
West_JR
  • 372
  • 2
  • 11
0
votes
1 answer

kapt not enabling incremental annotation processing

For some reason, Kapt complains that incremental compile is not enabled on one of my modules. However, I see no reason why is shouldn't be. The warning message when running core:kaptKotlin [WARN] Incremental annotation processing requested, but…
mdsimmo
  • 559
  • 5
  • 16
0
votes
1 answer

kapt generated files contain errors and prevent debugging unit tests from IntelliJ

I have a project I'm trying to unit test. The tests run fine. The following code is a dummy test for brevity: enum class QueryFilterOperator(val operator: String) { EQUAL("="), GREATER_THAN(">"), LOWER_THAN("<"), …
xlecoustillier
  • 16,183
  • 14
  • 60
  • 85
0
votes
1 answer

what is aptMode of kapt used for?

In the doc there are three values for the aptMode. Is there any detail information about these values ? What is the meaning of "stubs" ?
Liu Tom
  • 397
  • 2
  • 9
0
votes
1 answer

kotlin: spring and kapt not working together

I created a kotlin/gradle project using spring initializr. As stated here, if I try to add kapt like: plugins { kotlin("plugin.jpa") version "1.2.71" id("org.springframework.boot") version "2.1.6.RELEASE" …
vratojr
  • 818
  • 2
  • 8
  • 25
0
votes
1 answer

Dagger not see my own generated dependency

I have an issue with Dagger and my own generated code. Assumptions: I need to generate my own dagger component for UI tests purpose I have my own Gradle's module for annotation processing which provides dagger component with dependencies. Call this…
0
votes
3 answers

kapt compiler issue in studio 3.2.1 with data binding and room

Build fails with error "cannot find symbol DataBindingComponent" in all generated binding classes.If I remove the room compiler dependency from my module gradle, then it unable to find room db at run time saying "Db_Impl does not exist". def…
andronil
  • 1
  • 1
0
votes
0 answers

Kapt error after updating Kotlin version: java.lang.NoSuchFieldError: CONTENT_ROOTS

After updating Kotlin version from 1.2.51 to 1.3.11 I have a compilation error (kaptGenerateStubsDebugKotlin FAILED). e: java.lang.NoSuchFieldError: CONTENT_ROOTS at…
Humak
  • 1
0
votes
0 answers

Can't build the android project

I just upgrade kotlin 1.2.71 to 1.3.0-rc-190 and now I can't compile my project. Is the first time I see this error and I haven't found any solution, please help! The error log: 04:11:56.678 [ERROR]…
dcxo
  • 19
  • 5
0
votes
2 answers

Dagger 2 using classes generated by another library

I have a homemade library that generates DataMapper classes. They are generated with @Singleton and @Inject annotations to be able to inject them where i need them. But where it doesn't work is when Dagger tries to create the dependency tree, this…
Medsic
  • 131
  • 6
0
votes
2 answers

Unable to use Kotlin-kapt with kotlin/native

Compiler fails to recognise any kapt dependencies when used in common kotlin/native module apply plugin: 'konan' apply plugin: 'kotlin-platform-common' apply plugin: 'kotlin-kapt' repositories { mavenCentral() } dependencies { compile…
Nishita
  • 870
  • 1
  • 9
  • 33
0
votes
0 answers

Usage of generated classed inside Data Binding XML file

I have a problem with project build. I wrote my own annotation processor. It is generating helper class to use with Android context based on other, contextless class. This generated class is intended to use inside XML files that uses Data Binding. I…
0
votes
0 answers

adding "apply plugin: kotlin-kapt" fails to build

I've created a new Android project with Kotlin support. When I try to add apply plugin: 'kotlin-kapt' to build.gradle file, Gradle fails to sync the project. Here's the error: Folder…
0
votes
1 answer

Android: Integrating Kotlin with Dagger and Protobuf

I have existing project that builds successfully with Java, gRPC(Protobuf) and Dagger2. I want to add Kotlin to the project. I have converted data files to Kotlin quite easily. When I converted first activity (containing Dagger2) build failed. After…
Harsh Mahajan
  • 21
  • 1
  • 7
0
votes
2 answers

error: is incompatible with attribute : (attr) reference [weak]

I am trying to integrate this library. I got an issue of "missing attributes", so I added these attributes to my project:
Malwinder Singh
  • 6,644
  • 14
  • 65
  • 103
1 2 3
18
19