I am developing an AppEngine application where I gotta work with Google Calendar API. Because of some reasons, we are not using the lastest version of this API (v3) and we are working with gdata-calendar-v2 which is still working until the next November.
All right, I have two methods where I am using the Calendar Service. For one hand, I am adding a new event on my calendar and I do something like:
CalendarService myService = new CalendarService("my_calendar"); // error on this line
myService.setUserCredentials(EMAIL, PASSWORD);
As I know, it is working fine and I am adding new events on my calendar with no problems.
For another hand, I have another method where I do something different but I am using the same snippet code to connect to Google Calendar. In this case, I get this error:
Caused by: java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.copyOf([Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSet;
at com.google.gdata.wireformats.AltFormat$Builder.setAcceptableTypes(AltFormat.java:399)
at com.google.gdata.wireformats.AltFormat$Builder.setAcceptableXmlTypes(AltFormat.java:387)
at com.google.gdata.wireformats.AltFormat.<clinit>(AltFormat.java:49)
at com.google.gdata.client.Service.<clinit>(Service.java:558)
The libraries that I am using with -collections- and you can be interested are:
- Guava 11 (I already update to 18 and it's the same problem).
I know there is a very similar thread with the same problem right here but there is one difference: it is working fine in one method of my project and it is not working fine in another.
Can you give me a helping hand?
Thank you in advance, Diego.
Solution:
I have been searching in Google and I found out this thread I have changed my Guava to guava-10.0.1.jar and I don't get this error anymore.
The latest version of the gdata client library for java (version 1.46.0 as of this writing, found here: https://code.google.com/p/gdata-java-client/downloads/list) still embeds google-collections-1.0-rc1.jar inside their dependencies, and at this point it's not able to be replaced by the latest guava version.