5

There is a project which depends on google-api-client and google-api-services-drive.

google-api-client verion looks like this: 1.23.0, and there is a changelog on github for this library.

google-api-services-drive version looks like this: v3-rev105-1.23.0, and there is no clear changelog. There is a number of different rev suffixes for the same version number, like v3-rev116-1.23.0, v3-rev135-1.23.0, etc. It looks like it is built weekly with an increasing revision number.

The question is: How are client and services versions compatible? Is it safe to assume, that any service with version v3-revXXX-1.23.0 is compatible with client 1.23.0 , and any api-service with version v3-revYYYYMMDD-1.32.1 is compatible with api-client 1.32.1 ?

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
manuna
  • 729
  • 14
  • 37

1 Answers1

5

While it may look like common semantic versioning part signals compatibility, that doesn't seem to be the case.

However, there is a simple way to find out which google-api-client version a particular google-api-service requires. The thing is, google-api-service has a dependency on google-api-client, which you can... right, you can find it in a POM-file!

Looking at POM-files of different services, there are cases when, for example, a service version is v3-rev20210201-1.31.0 and it depends on a client version 1.31.1, while v3-rev20210612-1.31.0 depends on 1.31.5 Or even worse: a service version v3-rev20220508-1.32.1 depends on a client version 1.34.0.

manuna
  • 729
  • 14
  • 37
  • 7
    what a mess..., even the error message I got is laughable: `You are currently running with version 2.0.0 of google-api-client. You need at least version 1.15 of google-api-client to run version 1.23.0 of the Drive API library.` – Emanuel Moecklin Oct 08 '22 at 01:30
  • 1
    I [reported this error](https://issuetracker.google.com/issues/268844492) to Google. I tried downgrading my api-client lib to "v1.35.2" in `build.gradle` but for some reason the build keeps using v2.2.0. – Brian White Feb 13 '23 at 04:24
  • same for me for gmail api. `You are currently running with version 2.0.0 of google-api-client. You need at least version 1.31.1 of google-api-client to run version 1.32.1 of the Gmail API library.` – diAz May 25 '23 at 13:39
  • FYI you can find a version 2.0.0 here https://github.com/googleapis/google-api-java-client-services/tree/main/clients/google-api-services-androidpublisher/v3/2.0.0 - but to be blunt the whole process of setting this up is a mess – ToBe Jul 11 '23 at 21:13