I am using Google Tasks API and also Gogole Adwords API....To use Adwords API i have to use latest google-http-client jar...but when I use the latest jar, Tasks API doesnt seems to work. Here is the code I am using for tasks
HttpTransport httpTransport = new NetHttpTransport(); JacksonFactory jsonFactory = new JacksonFactory(); OAuthHmacSigner signer = new OAuthHmacSigner(); signer.clientSharedSecret = consumerSecret; GoogleOAuthDomainWideDelegation initializer = new GoogleOAuthDomainWideDelegation(); initializer.requestorId = "jags@solutiontest.com"; // email of the user, basically the xoauth_requestor_id URL param OAuthParameters parameters = new OAuthParameters(); parameters.consumerKey=consumerKey; parameters.version = "1"; parameters.signer = signer; initializer.parameters = parameters; Tasks service = Tasks.builder(httpTransport, jsonFactory).setHttpRequestInitializer(initializer).build(); Tasklists.List listTask = service.tasklists().list(); TaskLists taskLists = listTask.execute();
Here is the complete stacktrace for the error
java.lang.NoSuchMethodError: com.google.api.client.http.HttpRequest.setAllowEmptyContent(Z)Lcom/google/api/client/http/HttpRequest; at com.google.api.client.googleapis.services.GoogleClient.buildHttpRequest(GoogleClient.java:171) at com.google.api.client.http.json.JsonHttpRequest.buildHttpRequest(JsonHttpRequest.java:179) at com.google.api.client.http.json.JsonHttpRequest.executeUnparsed(JsonHttpRequest.java:207) at com.google.api.services.tasks.Tasks$Tasklists$List.execute(Tasks.java:1731)
What should I do in-order to use both Google Tasks and Google Adwords API? Any pointers will be grateful..
TIA,
VijayRaj