Android javax.annotation.processing Package missing

后端 未结 7 877
误落风尘
误落风尘 2020-12-30 00:01

I would like to do some annotation processing based on the example in the following link: http://www.zdnetasia.com/writing-and-processing-custom-annotations-part-3-39362483.

相关标签:
7条回答
  • 2020-12-30 00:07

    for kotlin DSL you need to use compileOnly("org.glassfish:javax.annotation:10.0-b28")

    for groovy DSL you need to use compileOnly 'org.glassfish:javax.annotation:10.0-b28'

    0 讨论(0)
  • 2020-12-30 00:10

    compileOnly 'org.glassfish:javax.annotation:10.0-b28'

    0 讨论(0)
  • 2020-12-30 00:11

    Simply adding compile 'javax.annotation:javax.annotation-api:1.2' should do the trick.

    see here for all available versions: https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api

    0 讨论(0)
  • 2020-12-30 00:14

    The javax.annotation.processing package is not included in Android. You don't need to include this inside your compiled app module. You just need this dependency for your compiler/processor module during build time. Therefore, inside your app's build.gradle you should add the following after including your annotation processor:

    provided 'org.glassfish:javax.annotation:10.0-b28'
    
    0 讨论(0)
  • 2020-12-30 00:20

    The javax.annotation.processing package is not included in Android, but the Android VM team describes how to include extra javax packages here - it might be applicable to your question.

    0 讨论(0)
  • 2020-12-30 00:20

    I find a method in butterknife. Add this in build.gradle:

    compile files(org.gradle.internal.jvm.Jvm.current().getJre().homeDir.getAbsolutePath()+'/lib/rt.jar')
    
    0 讨论(0)
提交回复
热议问题