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
6
votes
2 answers

Execution failed for task ':app:kaptGenerateStubsDebugKotlin'

after update android studio from electricEel to Flamingo plugin id 'kotlin-kapt' causing error Execution failed for task ':app:kaptGenerateStubsDebugKotlin'. > 'compileDebugJavaWithJavac' task (current target is 1.8) and…
Davanok
  • 73
  • 1
  • 4
6
votes
2 answers

Android Studio 3.2.1 with new dataBinding import doesn't compile

How can I resolve this issue? I installed a new Android Studio on my macOS and I would Like import dataBinding e to follow a tutorial about this technology. But when I import the dependencies and build the following error is shown. (Android Studio…
Rodrigo Ramos
  • 337
  • 2
  • 12
6
votes
2 answers

kapt An exception occurred: java.lang.OutOfMemoryError: GC overhead limit exceeded

I am facing this issue where while building my code I am getting this exception. I have tried increasing the heap space in both build.gradle and Manifest file but none of them seems to be working. I have also changed the gradle properties but that…
Sandip
  • 293
  • 3
  • 17
6
votes
2 answers

CircleCI 2.0 Android Build always Failing

I have the following in my CircleCI 2.0 config in the Android project code-base. version: 2 jobs: build: environment: TERM: dumb JVM_OPTS: -Xmx4g -Xms2g -XX:MaxPermSize=2g # ###### Use these for other…
AndroidRocks
  • 292
  • 4
  • 16
6
votes
1 answer

Gradle build step annotations kapt not building

I have Android Studio 3.1.2. I have Kotlin 1.2.41-release-Studio3.1-1. There are no references to annotationProcessor in the build.gradle, I only use kotlin-kapt: apply plugin: 'kotlin-kapt' My event log shows 0 warnings / errors: 10-05-18 13:24…
Jim Clermonts
  • 1,694
  • 8
  • 39
  • 94
6
votes
3 answers

Kapt not generating classes in Instant app feature module

I am using dagger2 in my android application. It is not generating dagger component classes even though there is no errors. I have enabled the annotation processors in the setttings and restart my android studio but that didn't work for me. I read…
N Sharma
  • 33,489
  • 95
  • 256
  • 444
6
votes
2 answers

kapt doesn't resolve protobuf-generated classes

I get such error during the build: e: /Users/some/path/SomeClass.java:86: error: cannot find symbol e: e: static ConnectionType getConnectionType(Context context) { e: ^ e: symbol: class ConnectionType e: location:…
VasyaFromRussia
  • 1,872
  • 2
  • 14
  • 18
6
votes
0 answers

Kotlin Kapt: java.lang.IllegalStateException: endPosTable already set

Trying to use the Kotlin maven plugin to build a kotlin application. Using Dagger 2 dependency injection framework. Get the following error when calling mvn clean compile package Can also be replicated by calling mvn clean package And then…
6
votes
1 answer

Is kapt supported in maven?

Is it possible to run kapt (kotlin annotation processing) in a maven based project? If yes how do I integrate kapt in maven build system?
sockeqwe
  • 15,574
  • 24
  • 88
  • 144
5
votes
1 answer

'"The compiler option dagger.hilt.android.internal.projectType is not a recognized Hilt option" - Android Hilt with multi module project

I have a project and recently we converted the project to a multi module. However I could not run the module it gives me this error. I think I made something wrong with the dependencies and some configurations. Following is my…
Hilal
  • 902
  • 2
  • 22
  • 47
5
votes
0 answers

kaptGenerateStubsKotlin, CreateProcess error=206

When running Gradle with Kotlin and kapt I get the following error message. Execution failed for task ':kaptGenerateStubsKotlin'. > java.io.IOException: Cannot run program "C:\openjdk\jdk-13\bin\java": CreateProcess error=206, The filename or…
Adrian Jandl
  • 2,985
  • 4
  • 23
  • 30
5
votes
0 answers

org.gradle.api.UncheckedIOException: java.io.IOException: Cannot run program : CreateProcess error=206, The filename or extension is too long

I am new to kotlin and was running a new project in android, it was working fine before but suddenly I am getting errors while running the application into the device I have tried searching all around the net - reinstalled android and wasted full…
Om Bala
  • 169
  • 3
  • 18
5
votes
2 answers

Additional-spring-configuration-metadata.json only merges with the configurationProperties generated metadata on second build

I have a kotlin spring boot auto configuration project. It has a class Annotated with @ConfigurationProperties. This generates the property metadata file as expected. I want to add a property that does not come from the @ConfigurationProperties…
Jacob Botuck
  • 411
  • 6
  • 22
5
votes
0 answers

kapt replaces generated class references with error.NonExistentClass despite kapt.correctErrorTypes being enabled

I have a custom annotation processor that does roughly this: generate an annotation type (classes using this type are deferred until later rounds) in a later round, process the classes using this type and generate some more files for them This has…
Namnodorel
  • 385
  • 5
  • 17
5
votes
1 answer

Checking if kapt uses incremental annotation processing

In Kotlin 1.3.30 support for incremental annotation processing was added: https://blog.jetbrains.com/kotlin/2019/04/kotlin-1-3-30-released/ According to the doc: Note that in the current implementation, using any non-incremental annotation…
Piotr Zawadzki
  • 1,678
  • 1
  • 18
  • 24