0
升级到最新的Android Studio 3.0.1后,我用Kapt注释处理遇到了一些错误。AndroidStudio 3.0+(TargetApi)上的Kapt问题
错误:
e: @TargetApi(Build.VERSION_CODES.LOLLIPOP)
e: ^
e: symbol: variable LOLLIPOP
e: location: class VERSION_CODES
e: C:\code\repos\android\app\build\tmp\kapt3\stubs\CustomView.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)
...
ENV:
ext.kotlin_version = '1.1.51'
...gradle-4.1-all.zip
compileSdkVersion 26
在项目中也有其他库与使用注释处理(匕首,butterknife)。 TargetApi有多个错误。这不是视图问题本身。
任何人都有类似的情况?有小费吗?
'./gradlew clean'有帮助吗? – theFunkyEngineer
当然不是。我尝试了很多东西,但仍然没有成功。 – user3198031