2015-06-14 38 views
0

我使用maven構建項目,我想向Google play服務添加依賴項。我的搖籃構建文件有如何在maven中指定google play服務依賴關係

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

,並在我下的「依賴」的pom.xml我把

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

但行家不斷抱怨「找不到神器」。 如何指定谷歌播放服務的依賴關係?

回答

1

從谷歌,開發者:

在谷歌之前的6.5播放服務的版本,你必須的API的整個包編譯到您的應用程序。在某些情況下,這樣做會使得應用程序中的方法數量(包括框架API,庫方法和自己的代碼)在65,536的限制之下變得更加困難。

從版本6.5開始,您可以選擇性地將Google Play 服務API編譯到您的應用中。

所以,嘗試更換 「版本」,在你的pom.xml到6.5或以上

+0

我現在有 \t \t \t com.google.android.gms \t \t \t google-play-services-wearable \t \t \t 7.5 \t \t \t AAR \t \t 但是我還是 「無法解析項目org.roboguice依賴關係:roboguice:罐子:3.1快照:找不到神器com.google.android.gms:谷歌-play-services-wearable:aar:7.5 in third.party.closed.source.repo「 – Christine

+0

我認爲64k限制並不重要,因爲gradle具有多個dex? multi-dex支持是讓我從Eclipse切換到Android Studio的原因。 – Christine

+0

mvn正在尋找maven_repo_3rd_party,但罐子在.m2回購。哼。 – Christine