Closed balaYYYYYYYY closed 1 year ago
Hi,
I'm a bit perplexed about the dependencies you're seeing in your tree. For example, your output shows the following:
+- com.google.api-ads:google-ads:jar:26.0.0:compile
| +- com.google.api:gax:jar:1.60.1:compile
| | +- org.threeten:threetenbp:jar:1.5.0:compile
| | +- com.google.api:api-common:jar:1.10.1:compile
| | \- io.opencensus:opencensus-api:jar:0.24.0:compile
| | \- io.grpc:grpc-context:jar:1.34.1:compile
| +- com.google.api:gax-grpc:jar:1.60.1:compile
Notice that the com.google.api:gax
and com.google.api:gax-grpc
dependencies are both resolving to 1.60.1
, which is a very old version of those libraries.
In contrast, I created a simple project with just two dependencies:
com.google.guava:guava:31.1-jre
com.google.api-ads:google-ads:26.0.0
When I look at the dependency tree for the simple project, it's resolving to version 2.29.0
of gax
and gax-grpc
, as expected.
--- com.google.api-ads:google-ads:26.0.0
+--- com.google.api:gax -> 2.29.0
+--- com.google.api:gax-grpc -> 2.29.0
...
I see a similar difference in the io.grpc:*
dependencies. In your project it's resolving to 1.34.1
, but in the simple project it's resolving to 1.55.1
.
In both cases, the dependencies in my simple project match what is shown on Maven:
https://central.sonatype.com/artifact/com.google.api-ads/google-ads/26.0.0/dependencies
This is all quite strange, and suggests that your local Maven repository may be corrupted in some way. Can you try renaming your local repository temporarily and building again to see if the dependency tree changes?
Thanks, Josh
I found the issue, it seems to be caused by the lower version of my Spring Cloud. However, I can't upgrade the Spring Cloud version of my project, so I have to start a new service.
You could try using the shaded version of the library as described at https://developers.google.com/google-ads/api/docs/client-libs/java/advanced-usage#shadow_dependencies.
I encountered this error while running the project, but I did not conflict with this library. Please help me see what the reason is
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
com.google.ads.googleads.v14.services.stub.KeywordPlanIdeaServiceStubSettings.defaultCredentialsProviderBuilder(KeywordPlanIdeaServiceStubSettings.java:253)
The following method did not exist:
com.google.api.gax.core.GoogleCredentialsProvider$Builder.setUseJwtAccessWithScope(Z)Lcom/google/api/gax/core/GoogleCredentialsProvider$Builder;
The method's class, com.google.api.gax.core.GoogleCredentialsProvider$Builder, is available from the following locations:
jar:file:/D:/Program/Java/maven/LocalRepository/com/google/api/gax/1.60.1/gax-1.60.1.jar!/com/google/api/gax/core/GoogleCredentialsProvider$Builder.class
The class hierarchy was loaded from the following locations:
com.google.api.gax.core.GoogleCredentialsProvider.Builder: file:/D:/Program/Java/maven/LocalRepository/com/google/api/gax/1.60.1/gax-1.60.1.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of com.google.api.gax.core.GoogleCredentialsProvider$Builder
this is my dependency tree