Skip to content
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

Android Studio 3.0 fails during desugar task due to guava's java 8 classes #585

Closed
okmanideep opened this issue Jan 18, 2018 · 2 comments
Closed

Comments

@okmanideep
Copy link

implementation "com.google.auto.value:auto-value:1.5"

causes

Error:com.android.builder.dexing.DexArchiveBuilderException: Error while dexing autovalue/shaded/com/google$/common/collect/$Multimaps.class
Error:com.android.dx.cf.code.SimException: default or static interface method used without --min-sdk-version >= 24
Error:Execution failed for task ':app:transformClassesWithDexBuilderForQaDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process /Users/ashwinikumar/Documents/Projects/android/app/build/intermediates/transforms/desugar/qa/debug/132.jar
Information:BUILD FAILED in 1m 30s

Although this issue disappears when you enable the new D8 dexer. It is not production ready as of now.

The only possible solution was to remove the implementation or compileOnly dependency on auto value and add the AutoValue annotation to the project manually as suggested in one of the issue comments

@JakeWharton
Copy link
Contributor

Using implementation for AutoValue is incorrect. It should be on the annotationProcessor classpath. You can use https://github.com/JakeWharton/AutoValueAnnotations on compileOnly for access to the annotations.

D8 is production ready as it is the default in AS / AGP 3.1.

@okmanideep
Copy link
Author

okmanideep commented May 29, 2018

Fixed with 1.6 and a separate artifact for annotations :auto-value-annotations.

Gradle dependencies now look like

implementation             "com.google.auto.value:auto-value-annotations:1.6"
annotationProcessor        "com.google.auto.value:auto-value:1.6"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants