Skip to content

Unable to authenticate GoogleAdsClient over Java 1.8 #360

@ahmadhashlamoun

Description

@ahmadhashlamoun

I'm trying to use Google Ads API, I already have my ads.properties file ready, and I added the following dependencies to my pom file:

<dependency> <groupId>com.google.api-ads</groupId> <artifactId>google-ads</artifactId> <version>9.0.0</version> </dependency>
<dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>27.0-jre</version> </dependency>
<dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> <version>4.4.8</version> </dependency>

But when I try to run the code like this:
File file = new File(this.getClass().getClassLoader().getResource("/ads.properties").getFile());
GoogleAdsClient googleAdsClient = GoogleAdsClient.newBuilder().fromPropertiesFile(file).build();

I get the following error:
org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V

Is there a problem with the library? And how could I fix it?
Would this be a problem with my credentials?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions