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 does not use AutoService. See the example code #1617

Closed
Xxj-star opened this issue Oct 18, 2023 · 2 comments
Closed

Android does not use AutoService. See the example code #1617

Xxj-star opened this issue Oct 18, 2023 · 2 comments

Comments

@Xxj-star
Copy link

image
image
ServiceLoader.load(service).iterator().hasNext() Why is this method always false
image

@Xxj-star
Copy link
Author

image

@chaoren
Copy link
Member

chaoren commented Oct 23, 2023

Android is not supposed to use anything. You have to add the annotation processor to the annotation-processor classpath yourself.

See https://github.com/google/auto/tree/main/service#getting-started

You will need auto-service-annotations-${version}.jar in your compile-time classpath, and you will need auto-service-${version}.jar in your annotation-processor classpath.

If it's not getting added to the annotation-processor classpath or if it's not getting run, then it's a problem with your build system. You should ask for help on a forum like Stack Overflow. This repository is not for troubleshooting your projects.

@chaoren chaoren closed this as completed Oct 23, 2023
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