2015-07-03 130 views
1

我正在開發Android應用程序,並希望支持回API版本15.Android設備4.4.4谷歌播放服務

我運行該設備具有Android版本4.4.4

谷歌播放服務安裝在版本爲4.4.52的設備上

需要將哪些依賴項添加到我的gradle中?我已經嘗試了一大堆,但還沒有運氣:

例子:

1)

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

然而這編譯它跑說播放服務失敗,需要更新。

2)

compile 'com.google.android.gms:play-services-location:4.4.52' 

這並不編譯,我得到以下錯誤,我是不知道該如何解決。

google play services 4.4.52 attribute "theme" has already been defined 

這裏是我的整個搖籃依賴列表:

compile 'com.android.support:appcompat-v7:22.2.0' 
compile 'com.squareup.retrofit:retrofit:1.9.0' 
compile 'org.parceler:parceler:0.2.13' 
compile 'com.jpardogo.materialtabstrip:library:1.1.0' 
compile 'com.squareup.picasso:picasso:2.5.2' 
compile 'com.google.android.gms:play-services-location:6.+' 
+0

'這將編譯但它不能在運行說播放服務需要一個update'那麼你爲什麼不更新谷歌播放服務? – tyczj

+0

你的意思是更新我的設備上的谷歌播放服務?目標是支持可能擁有我的設備版本的人員。我不能期望每個人都有更新正確的 – aherrick

+0

如果你想粒度使用谷歌播放服務即。只使用你想從谷歌播放服務的API,你需要使用最新的。否則,您需要聲明包含所有內容的谷歌播放服務 – tyczj

回答

0

您應該使用:com.google.android.gms:play-services-location:7.5.0

獲取以下信息:Google位置,活動識別和地點。

GooglePlay Service與運行Android 2.3或更高版本的Android設備兼容,並且包含Google Play商店。

約GOOGLEPLAY服務SDK中的所有信息,你可以看看:https://developers.google.com/android/guides/setup

+0

但是,如果谷歌播放服務版本7.5.0沒有安裝在用戶的設備上呢? – user3213851