The javax.annotation.processing package for Android is missing. Cannot use AbstractProcessor
The package is javax.annotation.processing
missing for some reason . I found this StackOverflow question about the same problem, but it gives a broken link as an answer. Have tried some of the things that Google has to offer but no results.
source to share
I assume you want to write an annotation handler in Android Studio and have a very general project structure in this case: Android application, Java lib with definitions, @interface
and Java lib with subclasses AbstractProcessor
.
I faced the same problem and one thing helped:
- Remove your Java module completely from the project layout.
- Make sure to keep only your code, delete all (or maybe just a file
.iml
?) Other stuff in the module directory. - Add your sources again as a module
Java Library
. Everything should work now.
I think it was because I first added the module as an Android library and then manually changed it to look like a Java library (default framework for gradle java plugin). But .iml
it belonged to the libb module structure anyway.
source to share