如何在maven中指定google播放服务依赖

How to specify google play services dependency in maven

我用maven建了一个项目,我想添加一个依赖到Google play services wear。我的 Gradle 构建文件有

compile 'com.google.android.gms:play-services-wearable:+'

在我的 pom.xml 下 "dependencies" 我把

<dependency>
  <groupId>com.google.android.gms</groupId>
  <artifactId>google-play-services</artifactId>
  <version>5</version>
  <type>aar</type>
</dependency>

但是 maven 一直在抱怨 "Could not find artifact"。 如何指定 google play services wear 的依赖?

来自 Google- 开发者:

In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs into your app. In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit.

From version 6.5, you can instead selectively compile Google Play service APIs into your app.

所以,尝试将你pom.xml中的"version"替换为6.5或以上