Closed ankitatcodingnebula closed 1 year ago
Have you seen this? https://github.com/mavlink/MAVSDK-Java/issues/79
@JonasVautherin Thank you for the response back. I did but I still get the same error as above. I have this in my build.gradle
implementation ('io.mavsdk:mavsdk:1.1.1') {
exclude group: "com.google.protobuf", module: "protobuf-javalite"
}
@divyanshu1234 would you have some idea by any chance? :pray: :innocent:
This is weird. I had fixed the problem in the library itself. So it isn't supposed to come. @ankitatcodingnebula are you using any other proto based dependency in your project?
Hi @divyanshu1234 No other proto based dependency.
Try to add the following as your dependencies:
def grpcVersion = "1.42.1"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-okhttp:${grpcVersion}"
implementation "io.grpc:grpc-protobuf-lite:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
If this doesn't work, can you share your build.gradle file here?
@divyanshu1234 Adding grpc dependencies as mentioned above worked. Thanks.
Could this be because these dependencies are added with implementation
instead of api
in the build.gradle of the artefact
build.gradle of mavsdk has this. Maybe changing them to api removes the need to re-declare these dependencies. Not sure.
compileOnly "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-okhttp:${grpcVersion}"
implementation "io.grpc:grpc-protobuf-lite:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
@ankitatcodingnebula I had had the same doubt several months ago, but adding these dependencies through the api
configuration will only cause conflicts when you add other protobuf dependencies to your project as they'll cause the duplicate class found error.
@JonasVautherin. I think you can close this issue.
Hello MAVSDK Team,
I updated the Java SDK from 0.8.0 to 1.x and started getting a compilation error on my project
startup failed:
I am not getting this error on any 0.x version. Is there a migration guide I need to follow? Please suggest