Android中的play-services-base与-basement依赖关系(AAR)

时间:2016-04-06 20:26:21

标签: android maven unity3d aar prime31

我找到了一个xml文件GoogleDependencyFlurryPlugin.xml

<dependencies>
<dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-base</artifactId><version>8.4+</version></dependency>
<dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-basement</artifactId><version>8.4+</version></dependency>
</dependencies>

确实是一个xml文件GoogleDependencyPlayGameServicesPlugin.xml

<dependencies>
<dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-games</artifactId><version>8.4+</version></dependency>
<dependency><groupId>com.google.android.gms</groupId><artifactId>play-services-plus</artifactId><version>8.4+</version></dependency>
</dependencies>

现在,前一个文件曾经

play-services-base&gt;或者&lt;发挥服务地下室

这似乎导致了一个巨大的问题。 AndroidJavaException:java.lang.NoSuchMethodError:一旦在设备上运行。

Android专家,如果你有&#34; base&#34; 你必须&#34;地下室&#34; ......或者反之亦然

确实,WRT游戏服务游戏或游戏服务加上,或许其中一个/两个都在某种程度上(或与之相反?)基地/地下室?

1 个答案:

答案 0 :(得分:11)

play-services-basementplay-services-base的依赖项。它是在Google Play服务版本8.1.0中引入的,以帮助缩小其他一些库的大小,例如play-services-adsplay-services-analytics

当您添加play-services-base时,您还会自动添加play-services-basement,因此无需添加显式相关性。

您可以检查本地Google存储库中每个库的依赖关系。

例如,对于库play-services-games,打开位于此处的文件pom文件:

extras/google/m2repository/com/google/android/gms/play-services-games/8.4.0/play-services-games-8.4.0.pom

这是文件的内容:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.android.gms</groupId>
  <artifactId>play-services-games</artifactId>
  <version>8.4.0</version>
  <packaging>aar</packaging>
  <dependencies>
    <dependency>
      <groupId>com.google.android.gms</groupId>
      <artifactId>play-services-base</artifactId>
      <version>8.4.0</version>
      <scope>compile</scope>
      <type>aar</type>
    </dependency>
    <dependency>
      <groupId>com.google.android.gms</groupId>
      <artifactId>play-services-drive</artifactId>
      <version>8.4.0</version>
      <scope>compile</scope>
      <type>aar</type>
    </dependency>
  </dependencies>
</project>

正如您所看到的,play-services-games取决于play-services-baseplay-services-drive