Dagger: 2.25 compiler jar missing shaded dependency classes

Created on 22 Oct 2019  路  7Comments  路  Source: google/dagger

After updating to use 2.25 running in a gradle build via kapt I am seeing:

java.lang.NoClassDefFoundError: dagger/shaded/auto/common/BasicAnnotationProcessor

A quick download of the sources jar shows they are missing there as well. (assuming they should have been included)

Most helpful comment

This should now be fixed in release 2.25.2

All 7 comments

Looks more like an issue in the pom file: https://search.maven.org/artifact/com.google.dagger/dagger-compiler/2.25/jar~~

<dependency>
  <groupId>com.google.dagger</groupId>
  <artifactId>dagger-producers</artifactId>
  <version>${project.version}</version>
</dependency>
<dependency>
  <groupId>com.google.dagger</groupId>
  <artifactId>dagger-spi</artifactId>
<!-- NOTICE THIS VERSION -->
  <version>${project.version}</version>
</dependency>
<dependency>
  <groupId>com.google.googlejavaformat</groupId>
  <artifactId>google-java-format</artifactId>
  <version>1.5</version>
</dependency>

What's wrong with that version?

Nothing, I was wrong and thought it wasn't properly escaped. I just learnt that it's allowed.

Also facing the same issue after updating to 2.25 on Android / Kotlin project

Caused by: java.lang.ClassNotFoundException: dagger.shaded.auto.common.BasicAnnotationProcessor
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)

Am I missing any configuration or new dependency ?

I believe this is something we broke by accident with a build refactoring. Sorry for the confusion, I'm not sure how this got past our testing. I hope to have this fixed by tomorrow.

Yeah, sorry! It looks like we accidentally removed the shaded auto/common sources when packaging the jar for "com.google.dagger:dagger-compiler:2.25". Most of our testing is done with bazel so it wouldn't catch this, and it looks like the few tests we ran with gradle didn't catch this because we were pulling in "com.google.dagger:dagger-android-processor:2.25" which _did have_ the shaded sources.

We'll try to push a 2.25.2 release by EOW, but a quick work-around is to just add a dependency on "com.google.dagger:dagger-android-processor:2.25".

This should now be fixed in release 2.25.2

Was this page helpful?
0 / 5 - 0 ratings