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

AutoService: Intermittent "Error reading configuration file" while processing #739

Open
caipre opened this issue Jun 5, 2019 · 5 comments
Labels
P3 type=defect Bug, not working as expected

Comments

@caipre
Copy link

caipre commented Jun 5, 2019

I believe #718 may be happening for AutoService as well. I have these dependencies listed in my build.gradle:

    implementation 'com.google.dagger:dagger:2.22.1'
    implementation "com.google.dagger:dagger-spi:2.23.1"
    implementation "com.google.auto.service:auto-service:1.0-rc5"
    annotationProcessor "com.google.auto.service:auto-service:1.0-rc5"

If I build with ./gradlew --stop && ./gradlew build, then I don't see the error (adding org.gradle.daemon=false to gradle.properties also works). Running ./gradlew build twice yields the following error:

$ ./gradlew build 
> Task :app:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileJava'.
> java.util.ServiceConfigurationError: dagger.spi.BindingGraphPlugin: Error reading configuration file

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
4 actionable tasks: 4 executed
@tbroyer
Copy link
Contributor

tbroyer commented Jun 6, 2019

Execution failed for task ':app:compileJava'.
java.util.ServiceConfigurationError: dagger.spi.BindingGraphPlugin: Error reading configuration file

Doesn't look like Auto service to me.

@caipre
Copy link
Author

caipre commented Jun 7, 2019

I'm registering my implementation for dagger.spi.BindingGraphPlugin via AutoService. If I write the resources/META-INF/services/dagger.spi.BindingGraphPlugin file explicitly (ie, stop using AutoService) then I don't get these errors.

Perhaps it's not a problem within AutoService though, but rather a race condition between the two annotation processors (since dagger is also an annotation processor). I'll try to collect more information.

@tbroyer
Copy link
Contributor

tbroyer commented Jun 7, 2019

@ronshapiro
Copy link
Contributor

@eamonnmcmanus who is probably our local expert on ServiceLoader weirdness. Should we be releasing the ServiceLoader alternative that AutoValue uses as a separate, standalone library?

@tbroyer
Copy link
Contributor

tbroyer commented Jun 7, 2019

Move it to AutoCommon ?

@raghsriniv raghsriniv added the P3 label Jun 24, 2019
@nick-someone nick-someone added the type=defect Bug, not working as expected label Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 type=defect Bug, not working as expected
Projects
None yet
Development

No branches or pull requests

5 participants