kapt

Kotlin + Dagger inject issue depending on device's Android Version / SDK (?)

走远了吗. 提交于 2019-12-22 08:14:22
问题 Last week, while implementing Dagger in my current Kotlin MVP project, I was testing it on oldy phone with KitKat 4.4.2 (yep, it still supports all major material features and stuff :)) due to primary phone's maintenance. So that week I was having typical issues rather than something unusual and fixed them more or less quickly by investigating provided errors. At long last, code compiled, current project version was built without issues and ran without major bugs on KitKat with UI interacting

Databinding annotation processor kapt warning

落爺英雄遲暮 提交于 2019-12-18 12:17:26
问题 In my app module's build.gradle, I have added dependencies { kapt('com.android.databinding:compiler:3.1.2') ... } but I'm still receiving the compiler warning for app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.android.databinding:compiler:3.1.2'. Everything functions, I just hate having warnings hanging around. Any help is much appreciated! 回答1: I had same warnings until I

Kotlin's kapt plugin for gradle does not work for custom source set (JMH)

谁说我不能喝 提交于 2019-12-14 03:54:39
问题 Having a Kotlin project with Gradle setup: apply plugin: 'kotlin' apply plugin: 'kotlin-kapt' dependencies { kapt 'org.openjdk.jmh:jmh-generator-annprocess:1.18' ... } Putting benchmarks under src/main/kotlin works without problems. But when i add a custom source-set for JMH: sourceSets { jmh { compileClasspath += sourceSets.test.runtimeClasspath runtimeClasspath += sourceSets.test.runtimeClasspath } } And move the benchmarks from src/main/kotlin to src/jmh/kotlin , executing the benchmarks

Kapt3: java.io.File cannot be cast to java.lang.String

烂漫一生 提交于 2019-12-11 06:15:25
问题 There is an exception when using apply plugin: 'kotlin-kapt' and running Gradle to build my app: Caused by: java.lang.ClassCastException: java.io.File cannot be cast to java.lang.String at org.jetbrains.kotlin.gradle.internal.Kapt3KotlinGradleSubplugin.disableAnnotationProcessingInJavaTask(Kapt3KotlinGradleSubplugin.kt:293) at org.jetbrains.kotlin.gradle.internal.Kapt3KotlinGradleSubplugin.buildOptions(Kapt3KotlinGradleSubplugin.kt:156) at org.jetbrains.kotlin.gradle.internal

gradle.properties kapt.incremental.apt=true breaks build

拟墨画扇 提交于 2019-12-08 02:49:39
问题 guys anybody had issus with incremental apt? I turn it on via kapt.incremental.apt=true but then gradle breaks with * What went wrong: Execution failed for task ':core:kaptDebugKotlin'. > Could not resolve all files for configuration ':core:_classStructurekaptDebugKotlin'. > Failed to transform file 'classes.jar' to match attributes {artifactType=class-structure, org.gradle.usage=java-runtime-jars} > Execution failed for StructureArtifactTransform: C:\Users\ursus\.gradle\caches\transforms-2

Kotlin + Room : java.lang.IllegalArgumentException: void cannot be converted to an Element

一世执手 提交于 2019-12-07 17:43:35
问题 I am trying to add Room in my project which is Java + Kotlin, but when I try to compile the project, it fails on :app:kaptDebugKotlin with following error: e: java.lang.IllegalStateException: failed to analyze: java.lang.IllegalArgumentException: void cannot be converted to an Element at org.jetbrains.kotlin.analyzer.AnalysisResult.throwIfError(AnalysisResult.kt:57) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules(KotlinToJVMBytecodeCompiler.kt:138) at org

Kapt not generating classes in Instant app feature module

末鹿安然 提交于 2019-12-07 03:38:40
问题 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 this thread too Dagger2 not generating Daggercomponent classes and read on one thread that apt is deprecated so I am using annotationProcessor Base Module build.gradle apply plugin: 'com.android.feature' apply plugin: 'kotlin-android' apply plugin:

Kotlin + Room : java.lang.IllegalArgumentException: void cannot be converted to an Element

走远了吗. 提交于 2019-12-05 19:40:40
I am trying to add Room in my project which is Java + Kotlin, but when I try to compile the project, it fails on :app:kaptDebugKotlin with following error: e: java.lang.IllegalStateException: failed to analyze: java.lang.IllegalArgumentException: void cannot be converted to an Element at org.jetbrains.kotlin.analyzer.AnalysisResult.throwIfError(AnalysisResult.kt:57) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules(KotlinToJVMBytecodeCompiler.kt:138) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:154) at org.jetbrains.kotlin.cli.jvm

Kotlin + Dagger inject issue depending on device's Android Version / SDK (?)

只谈情不闲聊 提交于 2019-12-05 18:19:20
Last week, while implementing Dagger in my current Kotlin MVP project, I was testing it on oldy phone with KitKat 4.4.2 (yep, it still supports all major material features and stuff :)) due to primary phone's maintenance. So that week I was having typical issues rather than something unusual and fixed them more or less quickly by investigating provided errors. At long last, code compiled, current project version was built without issues and ran without major bugs on KitKat with UI interacting. But when I took main phone with Nougat 7.1.2 from repair center and launched app on it I stuck with

Gradle DSL method not found: 'kapt()'

大憨熊 提交于 2019-12-04 09:03:23
问题 Gradle DSL method not found: 'kapt()' Possible causes: The project 'jetpacklearn' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0). Upgrade plugin to version 3.4.0 and sync project The project 'jetpacklearn' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file My gradleVersion is '3.4.0', but can not deal with it , ask me the same question classpath "com.android.tools.build