Closed jffiorillo closed 6 years ago
auto-value-gson is an extension to an annotation processor, not something you would compile in your app directly. See the download section of the README.md - https://github.com/rharter/auto-value-gson#download
but this is also happening when adding the library as provided
instead of compile
.
Then I suspect you have other libraries compiled against java 8 on your compile classpath. It's really hard to help you without a sample project that reproduces the code. Can you share one?
@hzsweers Do you recall our need for Java 8? AutoValue is set for source and target version 1.6, and I just did a quick test switching this to 1.7 and tests pass. I thought there might have been some conversation about it a while back, though.
If there is no need we could just drop the source and target compile versions to 1.7.
I think just modernity. Android SDK requires Java 8 now even, which I think makes it reasonable for a general purpose Java library to use it too.
I have created this PR to solve this issue: https://github.com/rharter/auto-value-gson/pull/145
That doesn't really solve your issue though. You're trying to compile an annotation processor into your app currently, and brings everything with it (guava, auto libraries, etc). This would remove the build failure but doesn't change the fact that your project dependency structure seems wrong. The Android gradle plugin should/will explicitly prevent you from putting annotation processors on anything other than the annotationProcessor
configuration, which will then fail your build again.
In order to use the @GsonTypeAdapterFactory
you need to compile
or provided
the library.
that's fair, but the proper solution I think is for us to split the annotations out to a separate artifact like auto-value-gson. Want to make your pull request do that instead?
extract_annotations_classes:josef@work:auto-value-gson$ git push --set-upstream origin extract_annotations_classes
remote: Permission to rharter/auto-value-gson.git denied to jffiorillo.
fatal: unable to access 'https://github.com/rharter/auto-value-gson.git/': The requested URL returned error: 403
Yes you don't have access to push to this repo, you must do it in a fork
actually - annotations are already a separate artifact. @rharter should we just lower that artifact's version to java 7?
Yeah, There's not need to require Java 8.
On December 2, 2017 at 9:27:36 PM, Zac Sweers (notifications@github.com) wrote:
actually - annotations are already a separate artifact. @rharter https://github.com/rharter should we just lower that artifact's version to java 7?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rharter/auto-value-gson/issues/142#issuecomment-348737510, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPJbkPT5pKQlN_oRpEejC5WhyUaoLuXks5s8hUngaJpZM4O7QkG .
compile 'com.ryanharter.auto.value:auto-value-gson:0.5.0'
I'm getting this error when I add the
compile
statement to thebuild.gradle