简体   繁体   English

错误:在依赖项更新后找不到符号方法getMap()

[英]error: cannot find symbol method getMap() after dependencies update

After I updated my dependencies my getMap() won't work. 更新我的依赖项后,我的getMap()将无法正常工作。 (it used to work just fine before update) (它曾经在更新前工作得很好)

Here is the line of codes i get error 这是我得到错误的代码行

GoogleMap map = ((MapView) mRootView.findViewById(R.id.fragment_map_mapview)).getMap();

Location locationNet = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
Location locationGps = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

The grandle code 爷爷的代码

dependencies
        {
            compile 'com.android.support:support-v4:24.0.0'
            compile 'com.android.support:appcompat-v7:24.0.0'
            compile 'com.android.support:cardview-v7:24.0.0'
            compile 'com.android.support:recyclerview-v7:24.0.0'
            //compile 'com.google.android.gms:play-services:7.3.0'
            compile 'com.google.android.gms:play-services:9.2.0'
            compile 'com.afollestad:material-dialogs:0.6.3.4@aar'
            compile 'com.bignerdranch.android:recyclerview-multiselect:0.1'
            compile 'com.j256.ormlite:ormlite-android:4.48'
            compile 'com.melnykov:floatingactionbutton:1.2.0'
            compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
            compile 'se.emilsjolander:StickyScrollViewItems:1.1.0'
            compile 'com.squareup.picasso:picasso:2.5.2'
            compile fileTree(include: ['*.jar'], dir: 'libs')
        }

getMap() method is a deprecated API which was removed in Google Play Services 9.2. getMap()方法是已弃用的API,已在Google Play Services 9.2中删除。 You'll need to replace this with getMapAsync() everywhere (or stay with the older release of Play Services). 您需要在任何地方用getMapAsync()替换它(或者使用旧版本的Play服务)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM