首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >MapFragment无法工作是因为Google Play服务失败

MapFragment无法工作是因为Google Play服务失败
EN

Stack Overflow用户
提问于 2017-03-13 06:21:25
回答 1查看 338关注 0票数 0

我有一个在我的活动中动态显示的MapFragment。

但它说我必须更新Google Play服务。我已经通过更新依赖项来做到这一点,但它不起作用。

有什么想法吗?

下面是我的Gradle文件:

代码语言:javascript
运行
复制
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:support-v4:25.1.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services:10.2.0'

}

我的片段:

代码语言:javascript
运行
复制
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="ibas.locatix_teamviewer.mapFragment">

<com.google.android.gms.maps.MapView
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:layout_marginTop="12dp"
    android:id="@+id/mapView"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true" />

下面是我的活动:

EN

回答 1

Stack Overflow用户

发布于 2017-03-13 07:30:56

您设备上的google play服务版本已过期。只需点击更新按钮,您就可以从play-store下载设备上的最新版本。

编辑: Stackoverflow上有这样的similar questions。你可能会发现这些问题和答案很有用。

根据documentation的说法,你的模拟器也应该使用Android4.2.2或更高版本。

要在使用Google Play services SDK时测试您的应用程序,您必须使用以下任一选项:

  • 运行安卓4.0或更高版本的兼容安卓设备,包括谷歌Play商店。

带有AVD的-The安卓模拟器,它运行基于安卓4.2.2或更高版本的Google API平台。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42753906

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档