Hi,
I am working on a Maven project, so I have both dependencies:
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-analyticsreporting</artifactId>
<version>v4-rev116-1.23.0</version>
</dependency>
<dependency>
<groupId>com.google.api-ads</groupId>
<artifactId>adwords-axis</artifactId>
<version>3.9.0</version>
</dependency>
My Adwords API project was working correctly until I added my code to the main project which has the Analytics API.
Now, I am getting this error:
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkNotNull(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
at com.google.api.ads.common.lib.auth.OfflineCredentials$Api.<init>(OfflineCredentials.java:89)
at com.google.api.ads.common.lib.auth.OfflineCredentials$Api.<clinit>(OfflineCredentials.java:81)
at aleph.dataconnectors.google.adwords.AdwordsArchiver.getCredentials(AdwordsArchiver.java:108)
at aleph.dataconnectors.google.adwords.AdwordsArchiver.processReports(AdwordsArchiver.java:191)
at aleph.dataconnectors.google.adwords.Runner.main(Runner.java:14)
If I comment out the "analytics" API then it works correctly. So I assume there is a conflict between both APIs.
BTW I got the error when my code is in this section:
Credential oAuth2Credential = new OfflineCredentials.Builder()
.forApi(Api.ADWORDS)
.fromFile()
.build()
.generateCredential();
Also I tried replacing the "credentials file" with "strings" (just for testing) but I am still having the same problem
.withClientSecrets(clientId, clientSecret)
.withRefreshToken(refreshToken)
Any ideas how to solve this conflict?
Thanks
-David