kapt

After adding Kapt plugin - A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution

馋奶兔 提交于 2020-08-17 12:11:31
问题 First of all, I'm pretty much aware that a lot of questions on this error had been posted already here, and none of them seems to be having a proper solution especially the one I need. I'm stuck with the following error for over a week. I'm working on an android project which is being built using Kotlin, MVVM, Clean Arch, and Navigation Components. I recently added realm database, and for that I had to add the following plugins. apply plugin: 'kotlin-kapt' apply plugin: 'realm-android' The

Android project with Java and Kotlin files, kapt or annotationProcessor?

有些话、适合烂在心里 提交于 2020-05-25 05:55:10
问题 I would like to know if in an Android project mixing Java and Kotlin files we must use annotationProcessor or kapt, or both ? In my understanding annotationProcessor must be used for Java files using annotations for code generation, and kapt must be used for Kotlin files using annotations for code generation. I have a project mixing both languages, and I just have replaced all the annotationProcessor dependencies in the build.gradle by kapt. Surprisingly it builds and seems to run correctly

Android project with Java and Kotlin files, kapt or annotationProcessor?

久未见 提交于 2020-05-25 05:55:07
问题 I would like to know if in an Android project mixing Java and Kotlin files we must use annotationProcessor or kapt, or both ? In my understanding annotationProcessor must be used for Java files using annotations for code generation, and kapt must be used for Kotlin files using annotations for code generation. I have a project mixing both languages, and I just have replaced all the annotationProcessor dependencies in the build.gradle by kapt. Surprisingly it builds and seems to run correctly

error: [Dagger/MissingBinding] Map<Class<? extends ViewModel>, Provider<ViewModel>> cannot be provided without an @Provides-annotated method

时光毁灭记忆、已成空白 提交于 2020-03-25 18:52:25
问题 I have the problem with Dagger/MissingBinding. I have red all the related answers on stackoverflow, I tried to use different versins of kotlin, gradle, dagger, I tried to use different workarounds such as kapt { correctErrorTypes = true } and kapt { generateStubs = true } , but the problem still go on. Error looks like: E:\AndroidStudioPrjcts\windygo\app\src\main\java\app\windygo\dagger\AppComponent.java:12: error: [Dagger/MissingBinding] java.util.Map<java.lang.Class<? extends androidx

Combining `by lazy` and `object` results in compiler-error “cannot find symbol”

别来无恙 提交于 2020-02-29 05:37:07
问题 I cannot compile anymore after the update to Kotlin 1.3.0 ( works in 1.2.71 ) when trying to use by lazy and object . This seems to happen only on my project. A demo-project is working fine. I want to add an interface to a given class and lazy-load its values. I've created a small example which is not working in my project but working fine in any other : open class Foo interface Bar { val lazyLoadedString : String } class Test { private val foo by lazy { object : Foo(), Bar { override val

Combining `by lazy` and `object` results in compiler-error “cannot find symbol”

落花浮王杯 提交于 2020-02-29 05:37:06
问题 I cannot compile anymore after the update to Kotlin 1.3.0 ( works in 1.2.71 ) when trying to use by lazy and object . This seems to happen only on my project. A demo-project is working fine. I want to add an interface to a given class and lazy-load its values. I've created a small example which is not working in my project but working fine in any other : open class Foo interface Bar { val lazyLoadedString : String } class Test { private val foo by lazy { object : Foo(), Bar { override val

When building Android project with Android Gradle Plugin v. 3.5.2 my builds fail

僤鯓⒐⒋嵵緔 提交于 2020-01-03 18:01:24
问题 with the following: at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211) at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211) at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211) at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211) at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211) Stack trace: > Task :app:kaptAppDebugKotlin FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed

NonExistentClass cannot be converted to Annotation - app:kaptDebugAndroidTestKotlin

允我心安 提交于 2019-12-25 01:12:46
问题 I want to test a class using JUnit5 but at the time gradle runs the app:kaptDebugAndroidTestKotlin task I get the issue. I have already tried the solutions in the following links but nothing helps so far: NonExistentClass cannot be converted to Annotation error: incompatible types: NonExistentClass cannot be converted to Annotation @error.NonExistentClass() my project build.gradle file: buildscript { ext.kotlin_version = '1.3.40' ext.anko_version='0.10.8' ext.junit_version='5.5.0'

Kotlin-Kapt Annotation Processor not working with maven

江枫思渺然 提交于 2019-12-24 07:46:44
问题 I want to generate jpa querydsl files from kotlin entity classes. There is a very good examples online of how to generate the dsl files using gradle https://github.com/JetBrains/kotlin-examples/blob/master/gradle/kotlin-querydsl/build.gradle. However I have tried to implement this in maven and have had no luck. My current pom is below. Does anybody know what the issue might be? Thanks in advance. <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM