title: Android Development: Service not registered: com.google.android.gms.common.internal.bf
body: <p>I'm using the "com.google.android.gms.maps.MapFragment" to display a map in a embedded fragment. When I try to close the activity (or wait a few seconds), the application crashes with the following error:</p>
  
  <pre><code>E/AndroidRuntime﹕ FATAL EXCEPTION: main
      java.lang.IllegalArgumentException: Service not registered: com.google.android.gms.common.internal.bf@5368ecf4
              at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:921)
              at android.app.ContextImpl.unbindService(ContextImpl.java:1459)
              at android.content.ContextWrapper.unbindService(ContextWrapper.java:484)
              at com.google.android.gms.common.stats.c.a(SourceFile:145)
              at com.google.android.gms.common.internal.bc.handleMessage(SourceFile:208)
              at android.os.Handler.dispatchMessage(Handler.java:95)
              at android.os.Looper.loop(Looper.java:137)
              at android.app.ActivityThread.main(ActivityThread.java:5041)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:511)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
              at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>I even tried to start the map fragment with a try/catch:</p>
  
  <pre><code>try {
              GoogleMapOptions options = new GoogleMapOptions();
              options.zoomControlsEnabled(true);
  
              mMapFragment = MapFragment.newInstance(options);
              FragmentTransaction fragmentTransaction =
                      getFragmentManager().beginTransaction();
              fragmentTransaction.add(R.id.map, mMapFragment);
              fragmentTransaction.commit();
  
              mMapFragment.getMapAsync(this);
          } catch (IllegalArgumentException e) {
              Log.e(application.DEBUG_STRING, "error: ", e);
          }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public void onMapReady(GoogleMap googleMap) {
  
          try {
              if (longitude &gt; 0 &amp;&amp; latitude &gt; 0) {
                  markers = new ArrayList&lt;MarkerOptions&gt;();
  
                  MarkerOptions parkingPosition = new MarkerOptions()
                          .position(new LatLng(latitude, longitude))
                          .title(getString(R.string.positionOfCar));
  
                  googleMap.addMarker(parkingPosition);
                  markers.add(parkingPosition);
  
                  LatLngBounds.Builder builder = new LatLngBounds.Builder();
                  for (MarkerOptions marker : markers) {
                      builder.include(marker.getPosition());
                  }
                  LatLngBounds bounds = builder.build();
  
                  int padding = 10; // offset from edges of the map in pixels
                  CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, padding);
  
  
  //            googleMap.moveCamera(cu);
  //            googleMap.animateCamera(cu);
                  googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(bounds.getCenter(), 10));
                  googleMap.moveCamera(CameraUpdateFactory.zoomTo(17));
  
                  Log.d(application.DEBUG_STRING, "zoom " + googleMap.getCameraPosition().zoom);
  
                  if (googleMap.getCameraPosition().zoom &gt;= 18) {
                      googleMap.animateCamera(CameraUpdateFactory.zoomTo(17));
                  }
              }
          } catch (IllegalArgumentException e) {
              Log.e(application.DEBUG_STRING, "error: ", e);
          }
      }
  </code></pre>
  
  <p>Has anyone an idea to fix the problem?</p>