You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
I had to add "implementation("com.google.protobuf:protobuf-java:3.24.0")" #40
I expected it to be bundled with the project dependencies. It seems like, it might be useful to add this as a side note for users. Thanks
As far as I know you would have to change the way your dependencies are added in your gradle.build, if you want to have these dependencies available transitively.
note that they are imported using implementation "..." .
This means your libraries are available during development, but won't be automatically made accessible to a user of the library.
The issue is that the client libraries methods return Guava-Objects. So Guava-Classes are part of your public facing api and thus part of the library. E.g:
public ListenableFuture<Points.ScoredPoint>> searchAsync(Points.SearchPoints request) {
// -> returns a Guava Listenable from com.google.common.util.concurrent
}
Gradle allows defining dependencies using api "..." which makes dependencies transitive:
dependencies {
errorprone "com.uber.nullaway:nullaway:0.10.18"
api "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-services:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
api "com.google.guava:guava:30.1-jre"
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
//...
}
A cleaner approach could be to abstract away third party dependencies on public facing api.
io.grpc:grpc-protobuf indeed needs to be included in your project.
OP mentioned about missing com.google.protobuf:protobuf-java, which for me is weird since I expected it to be available with the above.
I also had to add the Guava library in my case. The missing com.google.protobuf:protobuf-java should be following the same logic as in my last comment - Because SearchPoints extends a Protobuf-Class but is part of the public API of this library.
But just adding a note about the needed dependencies might be a simpler thing to do, indeed :)
thank you for describing a workaround in the Readme.md.
However, I think it would be better to fix the issue by using the right scopes for the dependencies as suggested by @Loahrs :
api "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-services:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
api "com.google.guava:guava:30.1-jre"
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
Activity
anush008 commentedon Jun 28, 2024
com.google.protobuf:protobuf-java:3.24.0shouldn't be required.Could you please describe more about the error/issue you ran into?
Loahrs commentedon Jul 3, 2024
Thank you, slazu!
I encountered the same problem. I also use Kotlin in my project with the newest qdrant-Client (1.10.0).
I was trying to do a search:
But then encountered the following errors in my IDE:

Adding the protobuf-Dependency fixed the errors for me.
anush008 commentedon Jul 3, 2024
I expected it to be bundled with the project dependencies.
It seems like, it might be useful to add this as a side note for users.
Thanks
Loahrs commentedon Jul 3, 2024
As far as I know you would have to change the way your dependencies are added in your gradle.build, if you want to have these dependencies available transitively.
The libraries dependencies are defined this way:
note that they are imported using
implementation "...".This means your libraries are available during development, but won't be automatically made accessible to a user of the library.
The issue is that the client libraries methods return Guava-Objects. So Guava-Classes are part of your public facing api and thus part of the library. E.g:
Gradle allows defining dependencies using
api "..."which makes dependencies transitive:A cleaner approach could be to abstract away third party dependencies on public facing api.
See: https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_separation
Also note the explanation here: https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_recognizing_dependencies
anush008 commentedon Jul 3, 2024
io.grpc:grpc-protobufindeed needs to be included in your project.OP mentioned about missing
com.google.protobuf:protobuf-java, which for me is weird since I expected it to be available with the above.anush008 commentedon Jul 3, 2024
Anyways, a note about these dependencies for consumers would be useful. Will do.
Thank you @slaszu and @Loahrs
Loahrs commentedon Jul 3, 2024
I also had to add the Guava library in my case. The missing
com.google.protobuf:protobuf-javashould be following the same logic as in my last comment - Because SearchPoints extends a Protobuf-Class but is part of the public API of this library.But just adding a note about the needed dependencies might be a simpler thing to do, indeed :)
p-dekker commentedon Jul 5, 2024
Using maven and java, I also have issues with class not accessible using the simple example from the readme.
I do have the tensorflow java bindings as well, so maybe they case havoc as they also use grpc libs.
anush008 commentedon Jul 16, 2024
Resolved with https://github.com/qdrant/java-client#gradle
sven42 commentedon Feb 12, 2025
Hi @anush008,
thank you for describing a workaround in the Readme.md.
However, I think it would be better to fix the issue by using the right scopes for the dependencies as suggested by @Loahrs :
sven42 commentedon Nov 28, 2025
Hopefully fixed with #93.