title: Cannot resolve method getMap() in Google Maps 10.0.1
body: <p>I had an old Android Project that I had left behind and I have decided to pick it up. But Im getting the "Cannot resolve method getMap()" error. I have tried doing whats <a href="https://stackoverflow.com/questions/38232747/cannot-resolve-method-getmap">here</a>, <a href="https://stackoverflow.com/questions/38282482/hi-in-my-activity-appears-this-cannot-resolve-method-getmap">here</a> and <a href="https://stackoverflow.com/questions/15699360/getmap-in-google-map-application-in-android">here</a>, but im getting stuck anyway. I know Im supposed to use getMapAsync, but I guess Im failing to implement that with MapView </p>
  
  <p>I think maybe its because Im using MapView and not SupportMapFragment. I tried changing that as well but I failed along the way.</p>
  
  <p>Here are he dependencies I want to use or rather im using:</p>
  
  <pre><code>compile 'com.google.android.gms:play-services-maps:10.0.1' //one with error
  //compile 'com.google.android.gms:play-services-maps:7.3.0' //one which works
  </code></pre>
  
  <p>I have a few methods which are being flagged, as im using the getMap(), more than once, but the error is flagged here:</p>
  
  <pre><code>GoogleMap map = ((MapView) mRootView.findViewById(R.id.mapview)).getMap();
  </code></pre>
  
  <p>The MapView is displayed in the following:</p>
  
  <pre><code>&lt;com.google.android.gms.maps.MapView
          android:id="@+id/mapview"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1" /&gt;
  </code></pre>
  
  <p>Im getting the following error:</p>
  
  <pre><code>12-09 09:14:33.231 15831-15831/com.empire.vince.vokers.yoworld E/AndroidRuntime: FATAL EXCEPTION: main
                                                                               Process: com.empire.vince.vokers.yoworld, PID: 15831
                                                                               java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.maps.android.clustering.ClusterManager.clearItems()' on a null object reference
                                                                                   at com.empire.vince.vokers.yoworld.mafragments.MapFragment.renderView(MapFragment.java:465)
                                                                                   at com.empire.vince.vokers.yoworld.mafragments.MapFragment.onMapReady(MapFragment.java:433)
                                                                                   at com.google.android.gms.maps.MapView$zza$1.zza(Unknown Source)
                                                                                   at com.google.android.gms.maps.internal.zzt$zza.onTransact(Unknown Source)
                                                                                   at android.os.Binder.transact(Binder.java:387)
                                                                                   at zu.a(:com.google.android.gms.DynamiteModulesB:82)
                                                                                   at maps.ad.t$5.run(Unknown Source)
                                                                                   at android.os.Handler.handleCallback(Handler.java:739)
                                                                                   at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                   at android.os.Looper.loop(Looper.java:234)
                                                                                   at android.app.ActivityThread.main(ActivityThread.java:5526)
                                                                                   at java.lang.reflect.Method.invoke(Native Method)
                                                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  </code></pre>
  
  <p>This is the first function of 4 which were using the GoogleMap object:</p>
  
  <pre><code>private void gimmeView()
  {
      // reference
  
     //final GoogleMap map = ((MapView) mRootView.findViewById(R.id.mapview)).getMap();
      final AdView adView = (AdView) mRootView.findViewById(R.id.adview);
  
      // map
      if(mGoogleMap!=null)
      {
          // add pois
         mGoogleMap.clear();
          mClusterManager.clearItems();
          for(PoiModel poi : mPoiList)
          {
              mClusterManager.addItem(poi);
          }
          mClusterManager.cluster();
      }
  
      // admob
      if(YoWorldConfig.ADMOB_MAP_BANNER &amp;&amp; NetworkManager.isOnline(getActivity()))
      {
          AdRequest adRequest = new AdRequest.Builder()
                  .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
                  .addTestDevice(getString(R.string.admob_test_device_id))
                  .build();
          adView.loadAd(adRequest);
          adView.setVisibility(View.VISIBLE);
      }
      else
      {
          adView.setVisibility(View.GONE);
      }
  }
  </code></pre>