Android javax.annotation.processing Package missing

六眼飞鱼酱① 提交于 2019-11-30 06:41:26
Jens

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.

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'
Dirk

There is a much easier way if you use Android Studio / Gradle.

I found the following looking through the answers of the question How do I add javax.annotation.Generated to Java SE 5?:

For a Gradle build the dependency should be

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

ToBe

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

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

turbofan

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')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!