2 回答

TA貢獻(xiàn)2051條經(jīng)驗(yàn) 獲得超10個(gè)贊
I have executed the command "mvn dependency:tree -Dverbose -Dincludes=com.google.guava"
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< com.sample:traducionMvn >---------------------
[INFO] Building traducionMvnPOM 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ traducionMvn ---
[INFO] com.cticontrol:traducionMvn:war:1.0-SNAPSHOT
[INFO] \- com.google.guava:guava:jar:27.0.1-jre:compile
[INFO] +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] \- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.607 s
[INFO] Finished at: 2019-02-18T11:27:14+01:00
[INFO] ------------------------------------------------------------------------
my pom is:
<!-- Dependecias API TRADUCTOR GOOGLE -->
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-translate</artifactId>
<!-- <version>1.61.0</version> -->
<version>1.62.0</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<artifactId>com.google</artifactId>
<groupId>guava</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.28.0</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<artifactId>com.google</artifactId>
<groupId>guava</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.0.1-jre</version>
</dependency>
<!-- Fin dependencias API -->
------------------------------------
I keep giving the same error.

TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超5個(gè)贊
發(fā)生這種情況是因?yàn)間oogle-api-client版本依賴于 Guava 的版本。不要在 pom.xml 中使用 guava依賴項(xiàng),而是嘗試更改為直接的android 變體:1.28.026.0-android27.0.1-jre-jre26.0-jre
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>26.0-jre</version>
</dependency>
有關(guān)此討論的更多信息,有一個(gè)小線程。
添加回答
舉報(bào)