0

After upgrade to latest Android Studio 3.0.1 I hit on some errors with Kapt annotation processing.

Error:

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

In project there are also other libs with use annotation processing (dagger, butterknife). There are multiple errors with TargetApi. It's not the View problem itself.

Anyone had similar case? Any tips?

1 Answers1

0

Finally I found the reason. We using old lib:

com.path:android-priority-jobqueue:1.1.2 

which have old android dependencies.

com.path:android-priority-jobqueue:1.1.2
com.google.android:android:2.2.1
commons-logging:commons-logging:1.1.1
org.apache.httpcomponents:httpclient:4.0.1
org.apache.httpcomponents:httpcore:4.0.1
commons-logging:commons-logging:1.1.1
commons-codec:commons-codec:1.3
org.khronos:opengl-api:gl1.1-android-2.1_r1
xerces:xmlParserAPIs:2.6.2
xpp3:xpp3:1.1.4c
org.json:json:20080701
Ko Vartthan
  • 434
  • 1
  • 4
  • 22