Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Google Sheets API: Getting java.lang.NoSuchMethodError when try running the quickstart example #7332
Comments
|
You appear to be using old and incompatible versions of the libraries. setResponseReturnRawInputStream was added in google-http-client 1.29.0, but you are getting an older version of this google-http-client transitively via your old dependency declarations. The sheets client you are using depends on a very old dependencies. v4-rev2020-0908 is the latest version. google-api-client 1.30.10 is the latest version of that client. |
|
Hi @chingor13 , Thanks for the dependencies clarification. However, I am still getting the same error. build.gradle repositories { dependencies { |
Environment details
build.gradle
plugins {
id 'java'
id "com.katalon.gradle-plugin" version "0.0.7"
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.api-client:google-api-client:1.30.4'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.30.6'
compile 'com.google.apis:google-api-services-sheets:v4-rev581-1.25.0'
}
Steps to reproduce
java.lang.NoSuchMethodError: com.google.api.client.http.HttpRequest.setResponseReturnRawInputStream(Z)Lcom/google/api/client/http/HttpRequest;
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:434)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:541)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:474)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:591)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$execute.call(Unknown Source)
Any additional information below
The error is reproduced from the following:
ValueRange response = service.spreadsheets().values().get(spreadsheetId, range).execute();
Would you please help on this? Thanks.