2013-04-04 23 views
0

我需要使用谷歌地圖Android API V2在我的Android應用程序,我使用Maven來處理我的依賴和構建過程中,如何添加「google-play-services_lib」(谷歌地圖V2)作爲一個apk庫依賴

我沒有按照這個教程來設置API V2 https://developers.google.com/maps/documentation/android/start

我的問題是如何增加「的Google Play-services_lib」作爲一個依賴於我的項目(如apkLib)

山姆。

+0

你試試這個? https://github.com/JakeWharton/gms-mvn-install – akaya 2013-04-04 14:38:58

+0

我使用的是Windows,該軟件包中沒有Windows安裝程序,我是否需要使用Cygwin來安裝它? – Sam 2013-04-04 15:39:54

+0

I'Installed Cygwin並運行sh文件,我得到以下錯誤「./gms-mvn-install.sh ./gms-mvn-install.sh:第2行:$'\ r':命令未找到 :invalid optionl.sh:line 3:set: - set:usage:set [--abefhkmnptuvxBCHP] [-o option-name] [arg ...] ./gms-mvn-install.sh:line 4 :$'\ r':未找到命令 ./gms-mvn-install.sh:第94行:語法錯誤:文件意外結束 「 – Sam 2013-04-04 16:21:26

回答

1

使用https://github.com/mosabua/maven-android-sdk-deployer

,並添加以下的依賴到POM

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