-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Generated not found #95
Comments
@sockeqwe: just fast fix but did you tried to add this:
|
jep, that works! Im wondering if I'm the only one who is facing this problem? |
Oh, it seems that it's working fine with My problem was, that I have used |
That said, you need |
Yep. Android's API jar lacks Generated. You will always need to include an
|
this is a local project configuration matter. If you're targetting a JVM that doesnt' have it, you need to add it, per the instructions above. |
Why Glassfish? Why not the official Java annotations from Oracle? |
I think the correct dependency which should be added is I added this to my Android Gradle project:
|
I just submitted some code (and will be linked to this issue in the next MOE sync) that omits |
…time classpath. See Github Issue #95 for users that get stuck when compiling for Android and their build fails because the annotation is not present. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=109933503
*** Reason for rollback *** Lots of down-stream compilation failures in continuous integration. *** Original change description *** Only omit @generated if javax.annotation.Generated is on the compile-time classpath. See Github Issue #95 for users that get stuck when compiling for Android and their build fails because the annotation is not present. *** ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=109941410
…ime classpath. See Github Issue #95 for users that get stuck when compiling for Android and their build fails because the annotation is not present. *** Rollforward of a prior commit. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=110258324
The commit which omits @generated is now synced and should be in a |
Probably this happened because the system JDK_HOME is more upgraded then the JDK that comes with Android Studio |
I have installed sdkman more here: https://sdkman.io/usage#installdefault, downgraded java version from 11 to 8 and this error did go away. That way it worked for me. |
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:
Any idea what could be wrong?
Do I have to add the javax annotation dependency to my
build.gradle
?The text was updated successfully, but these errors were encountered: