googleapis/google-api-java-client

Services dont work with library v2.x

kool79 opened this issue · 2 comments

Every service (actually tested on Drive nd Sheets) has version check in static initializer:

 static {
    com.google.api.client.util.Preconditions.checkState(
        com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION == 1 &&
        com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION >= 15,
        "You are currently running with version %s of google-api-client. " +
        "You need at least version 1.15 of google-api-client to run version " +
        "1.25.0 of the Google Sheets API library.", com.google.api.client.googleapis.GoogleUtils.VERSION);
  }

Bacause of this I have an error when use the latest google-api-java-client v2.2.0 with the latests versions of services (1.25.0):
You are currently running with version 2.2.0 of google-api-client. You need at least version 1.15 of google-api-client

@kool79 Thanks for filing this issue! The error you are seeing is looking very similar to #2137. Could you help us confirm if you see the same issue when using google-api-client v1.35.2?

Hi, @mpeddada1
I did not try to use 1.35.2 but I think it will work fine with client v1.25

Actually I fixed my issue by updating to the latest version of servise (I use google-api-services-drive and google-api-services-sheets). The reason was my wrong assumption that I use the latest versions of services.

Initially I use mvnrepository.com to search for the latest versions of services. But unfortunately this search engine does not return the latest version. It shows that the latest version is 1.25, which does not work with google-api-java-client v2.x.x:
scr_2023_02_23T18_50_58

But then I use https://search.maven.org/ and got the actual letest version for my services (v2.0.0):
scr_2023_02_23T18_58_46