[go: up one dir, main page]

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

Dagger 2.14 breaks build #994

Closed
bubenheimer opened this issue Dec 19, 2017 · 9 comments
Closed

Dagger 2.14 breaks build #994

bubenheimer opened this issue Dec 19, 2017 · 9 comments

Comments

@bubenheimer
Copy link

Tried 2.14 (upgrade from 2.13), but it's breaking my build, Android Studio 3.0.1, Java 8. The gRPC-related Dagger part of my build (it's gRPC server code) seems to have particular trouble. gRPC-java 1.8.0. gRPC classes and Dagger classes are not generated. I have not isolated the issue to a small sample project at this point, but a possible cause I see is below, maybe that gives a pointer. I don't have any explicit dependency on Google Auto libs in that part of the build.

java.lang.NoClassDefFoundError: com/google/auto/common/MoreTypes
@ronshapiro
Copy link
ronshapiro commented Dec 19, 2017

Can you give more of a stack trace (if javac gives you one)? All of our processors should be shading auto common - https://github.com/google/dagger/blob/master/BUILD#L67,L88,L97 so this shouldn't be happening (but there could always be a bug!)

@technoir42
Copy link

Looks like com.google.auto:auto-common is not there in POM:
http://search.maven.org/#artifactdetails%7Ccom.google.dagger%7Cdagger-compiler%7C2.14%7Cjar

@JakeWharton
Copy link
JakeWharton commented Dec 19, 2017 via email

@ronshapiro
Copy link
ronshapiro commented Dec 19, 2017

I did a recursive javap -c -p over the three processor jars and I'm not seeing anything here that refers to auto common (as @JakeWharton mentioned, it's shaded). Perhaps one of our dependencies does use it though, maybe AutoAnnotation (though that should resolve transitively if it does)?

@ronshapiro
Copy link
ronshapiro commented Dec 19, 2017

Ohhhh, we may need auto common shaded in the SPI artifact.

@technoir42
Copy link

Relevant stacktrace:

Caused by: java.lang.NoClassDefFoundError: com/google/auto/common/MoreTypes
        at dagger.model.Key$Builder.type(Key.java:111)
        at dagger.model.Key.builder(Key.java:102)
        at dagger.internal.codegen.KeyFactory.forInjectConstructorWithResolvedType(KeyFactory.java:253)
        at dagger.internal.codegen.InjectBindingRegistryImpl.tryRegisterMembersInjectedType(InjectBindingRegistryImpl.java:266)
        at dagger.internal.codegen.InjectBindingRegistryImpl.tryRegisterMembersInjectedType(InjectBindingRegistryImpl.java:257)
        at dagger.internal.codegen.InjectProcessingStep$1.visitVariableAsField(InjectProcessingStep.java:69)
        at dagger.internal.codegen.InjectProcessingStep$1.visitVariableAsField(InjectProcessingStep.java:59)
        at com.sun.tools.javac.code.Symbol$VarSymbol.accept(Symbol.java:1237)
        at dagger.internal.codegen.InjectProcessingStep.process(InjectProcessingStep.java:58)
        at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:330)
        at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:181)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
        at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)

@ronshapiro
Copy link

Ok that's what I suspected. Thanks for finding this, I'll make a fix soon

ronshapiro added a commit that referenced this issue Dec 19, 2017
Fixes #994

RELNOTES=Fix a NoClassDefFound issue with `2.14`

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179589702
@ronshapiro
Copy link

Will you report back if 2.14.1 doesn't fix this?

@bubenheimer
Copy link
Author
bubenheimer commented Dec 20, 2017

2.14.1 fixed it for me - thanks for the quick fix!

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

4 participants