Google Play服务地图9.2.0问题 [英] Google play services maps 9.2.0 issue

查看:175
本文介绍了Google Play服务地图9.2.0问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


编译项目(':googleplayservices_lib')我的Android应用程序已成功使用地图,包括以下内容: )

我的SDK管理员说我有rev 32,看起来是最新的。所以,一切都工作得很好。



现在我正在增强应用程序,我看到一些帖子说我现在可以在添加标记时使用zIndex参数控制Z指数。但要做到这一点,我必须在我的gradle中添加以下内容。 。 。


编译'com.google.android.gms:play-services-maps:9.2.0'


现在我的gradle文件有这个依赖关系部分。 。 。

 依赖关系{
编译项目(':library')
编译项目(':googleplayservices_lib' )
编译文件('libs / gson-2.2.4.jar')
编译'com.android.support:appcompat-v7:22.0.0'
编译'com.android。 support:design:22.2.1'


compile'c​​om.google.android.gms:play-services-maps:9.2.0'
}

现在我可以设置zIndex,但是这个新版本显然伴随着突变。例如,以下内容不再有效。 。 。

  map =((SupportMapFragment)getSupportFragmentManager()。findFragmentById(R.id.map))
.getMap ();

map是GoogleMap。编译器无法解析getMap()方法。我的问题是,我似乎无法找到这个新的地图修订版的文档,它讨论了对这个新版本的重大改变。有人知道我在哪里可以找到这样的信息吗?

解决方案


我的Android应用程序已成功使用地图通过在我的gradle中包含以下内容


假设这是旧版Eclipse库项目版的Play项目副本SDK。理想情况下,当您转移到Android Studio时,您将不得不将其移到Play Services SDK构件。


$ b


我的SDK管理员说我有Rev 32,看起来是最新的


由于您使用的是本地项目内副本,因此SDK Manager报告的内容不是直接相关的。

另外,谷歌至少在过去的几个月里一直没有维护这个库项目,所以这个库的最新在使用最新版本的Play Services SDK。

lockquote

现在我的gradle文件有这个依赖关系部分。 。 。

我很惊讶编译。删除编译项目(':googleplayservices_lib')。如果您使用的是地图V2以外的Play Services SDK的部分内容,将这些API的适当和兼容的构件用作


$ b


编译器无法解析getMap()方法。


getMap()大约在20个月前被弃用,转而使用 getMapAsync()


我的问题是,我似乎无法找到这个新的地图修订版本的文档,此新版本。

Maps V2发行说明位于 Play服务文档。 Maps V2发行说明的一个子集合并在整个Play服务发布说明中。


My Android app has been successfully using maps by including the following in my gradle ...

compile project(':googleplayservices_lib')

My SDK manager says I have rev 32 which appears to be the latest. So with this, everything has been working just fine.

Now I'm enhancing the app and I saw some posts that says I can now use zIndex parameter when adding a marker to control the Z Index. But to do this I must add the following to my gradle . . .

compile 'com.google.android.gms:play-services-maps:9.2.0'

So now my gradle file has this dependencies section . . .

dependencies {
    compile project(':library')
    compile project(':googleplayservices_lib')
    compile files('libs/gson-2.2.4.jar')
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.android.support:design:22.2.1'


    compile 'com.google.android.gms:play-services-maps:9.2.0'
}

Now I'm able to set zIndex but this new version apparently comes with breaking changes. For instance the following no longer works . . .

map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
        .getMap();

map is a GoogleMap. The compiler cannot resolve the getMap() method. My problem is that I can't seem to locate the documentation on this new maps revision where it discusses breaking changes for this new version. Does anyone know where I can find such information?

解决方案

My Android app has been successfully using maps by including the following in my gradle

Presumably, that is an in-project copy of the old Eclipse library project edition of the Play Services SDK. Ideally, you would have moved off of that to the Play Services SDK artifacts back when you moved to Android Studio.

My SDK manager says I have rev 32 which appears to be the latest

Since you are using a local in-project copy, what the SDK Manager reports is not directly relevant.

Also, Google has not been maintaining that library project for at least the past several months, so "latest" of that library is meaningless with respect to using the latest version of the Play Services SDK.

So now my gradle file has this dependencies section . . .

I am surprised that compiles. Remove compile project(':googleplayservices_lib'). If you are using parts of the Play Services SDK beyond Maps V2, use appropriate and compatible artifacts for those APIs as well.

The compiler cannot resolve the getMap() method.

getMap() was deprecated about 20 months ago, in favor of getMapAsync().

My problem is that I can't seem to locate the documentation on this new maps revision where it discusses breaking changes for this new version.

Maps V2 release notes are in the Play Services documentation. A subset of Maps V2 release notes are incorporated in the overall Play Services release notes.

这篇关于Google Play服务地图9.2.0问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆