@Generated not found *javax.annotation.processing.Generated*
See original GitHub issueI am seeing this issue when trying to compile an Android project with Dagger2 (Google I/O 2018 sample app).
package javax.annotation.processing does not exist
import javax.annotation.processing.Generated;
I have tried the several solutions mentioned in the issues and stack overflow for resolving javax.annoation.Generated
but not having any luck. Note the annotation is in the javax.annotation.processing
package.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:32
- Comments:35
Top Results From Across the Web
Generated annotation using gradlew + dagger - Stack Overflow
Dagger uses auto-common 's GeneratedAnnotations to figure out which @Generated annotation to use. It does this based on the classpath.
Read more >error: cannot find symbol @javax.annotation.Generated
I expected the test case to run easily since I did not change anything from the git clone. What happens instead? error: cannot...
Read more >Room appears to use the wrong Generated annotation when ...
My application started to fail during compilation. I get the error that the @Generated Annotation can not be found because the package javax.annotation...
Read more >Generated (Java SE 9 & JDK 9 ) - Oracle Help Center
Package javax.annotation.processing. Annotation Type Generated ... The Generated annotation is used to mark source code that has been generated.
Read more >Error when building Android capture App build in android studio
... DHIS2\V2\dhis2-android-capture-app\commons\build\generated\source\ ... java:4: error: package javax.annotation.processing does not exist ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Manually create
Generated
interface in your project. There could bepackage exists in another module: java.compiler
error if adding in android app module, but creating in android-library module (and then adding it to main viaimplementation project(':module-generated')
) works fine.I’ve uploaded package with such class to JCenter https://github.com/pengrad/jdk9-deps Now it’s possible to just add this gradle dependency and it compiles with JDK11:
compileOnly 'com.github.pengrad:jdk9-deps:1.0'
My issue turned out to be related to JDK9 - explicitly using JDK 1.8 resolved the issue for me. ¯\_(ツ)_/¯
Add the following to gradle.properties
Note setting JAVA_HOME did not work for me