I got this error when I am using:
com.android.tools.build:gradle:3.4.0-beta03(or 3.3.0)
gradle-wrapper: gradle-5.1.1-all.zip
apollo-gradle-plugin: 1.0.0-alpha5(or 1.0.1-SNAPSHOT)
apollo-runtime: 1.0.0-alpha5
apollo-android-support: 1.0.0-alpha5
and especially, I am using Kotlin(1.3.20).
If I downgrade the gradle wrapper to gradle-4.10.1-all, everything is fine, no error and could compile the project successfully. Could anyone help?
I had the same error, was solved for me by adding compileOnly 'javax.annotation:jsr250-api:1.0'.
Cool, it finally works, thx @oskarh 馃榾
I also encountered this using java 11. For me I had to include the following compileOnly dependencies to my build.gradle. It may be worthwhile to include this in the README.md
compileOnly group: "javax.annotation", name: "javax.annotation-api", version: "1.3.2"
compileOnly group: "org.jetbrains", name: "annotations", version: "13.0"
Really appreciate the workarounds, but any updates on what the actual issue is here?
I'm getting this after updating the plugin to last version. any updates?
Also the okHttpClient become Unresolved.
Stumbled upon the same problem after updating gradle wrapper to 5.1. Can confirm that the workaround suggested by @rhysmccaig fixed the issue for me.
I'm still seeing this error. I've bumped to version 1.0.1, and replaced JSR250 compile dependency with jetbrains as described in #1299. However I'm still seeing
.../app/build/generated/source/apollo/classes/example/MyQuery.java:24: error: package javax.annotation does not exist
import javax.annotation.Generated;
^
.../app/build/generated/source/apollo/classes/example/MyQuery.java:28: error: cannot find symbol
@Generated("Apollo GraphQL")
^
symbol: class Generated
.../app/build/generated/source/apollo/classes/example/type/CustomType.java:7: error: package javax.annotation does not exist
import javax.annotation.Generated;
^
.../app/build/generated/source/apollo/classes/example/type/CustomType.java:9: error: cannot find symbol
@Generated("Apollo GraphQL")
^
symbol: class Generated
4 errors
Same scenario to @tir38. Using version 1.0.1 and applied what was mentioned in #1299. Tried both @oskarh and @rhysmccaig solutions and both work fine. Is this advisable?
Most helpful comment
I had the same error, was solved for me by adding
compileOnly 'javax.annotation:jsr250-api:1.0'.