在升级到最新的Android Studio 3.0.1之后,我使用Kapt注释处理遇到了一些错误。
错误:
e: @TargetApi(Build.VERSION_CODES.LOLLIPOP)
e: ^
e: symbol: variable LOLLIPOP
e: location: class VERSION_CODES
e: C:codeeposandroidappuildmpkapt3stubsCustomView.java:82: error: annotation @TargetApi is missing a default value for the element 'value'
e: java.lang.IllegalStateException: failed to analyze: org.jetbrains.kotlin.kapt3.diagnostic.KaptError: Error while annotation processing
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.K2JVMCompiler.doExecute(K2JVMCompiler.kt:58)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:103)
...
有关:
ext.kotlin_version = '1.1.51'
...gradle-4.1-all.zip
compileSdkVersion 26
在项目中还有其他libs使用注释处理(dagger,butterknife)。 TargetApi存在多个错误。这不是View问题本身。
有人有类似的情况?有小费吗?