question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@Generated not found

See original GitHub issue

Hi, I think it’s a problem with my environment (java 1.7.0_51, 64 bit, mac os 10.10), but I’m using Android Studio and tried to setup a simple android sample application with dagger 2 as dependency injection framework.

My compiler can not resolve the @Generated annotation in class path (import javax.annotation.Generated;) which is used in all dagger generated classes.

My gradle build file looks like this:

compile 'com.google.dagger:dagger:2.0-SNAPSHOT'
provided 'com.google.dagger:dagger-compiler:2.0-SNAPSHOT'

Any idea what could be wrong? Do I have to add the javax annotation dependency to my build.gradle?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:12

github_iconTop GitHub Comments

8reactions
radziocommented, Dec 17, 2014

@sockeqwe: just fast fix but did you tried to add this:

compile 'org.glassfish:javax.annotation:10.0-b28'
5reactions
rafnogueiracommented, Feb 20, 2019

Probably this happened because the system JDK_HOME is more upgraded then the JDK that comes with Android Studio

Read more comments on GitHub >

github_iconTop Results From Across the Web

@Generated not found *javax.annotation.processing ... - GitHub
I am seeing this issue when trying to compile an Android project with Dagger2 (Google I/O 2018 sample app). package javax.annotation.processing ...
Read more >
IntelliJ error: cannot find symbol @javax.annotation.Generated
I found this symbol error a few times but no resolution that helped. I tried invalidating caches and restarting a few times.
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 Platform SE 8 ) - Oracle Help Center
The Generated annotation is used to mark source code that has been generated. It can also be used to differentiate user written code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found