Repository: flutter
Issue: NullPointerException for 'google_maps_flutter' plugin
Labels: c: crash,platform-android,p: maps,package,a: production,P2,c: fatal crash,team-android,triaged-android

Hi,

I am seeing the following NPE for my app at the Google Play Console - this error happened on Note 10+, but there are other devices as well impacted by this issue. 

I am using latest version of google_maps_flutter plugin and my Flutter version is 2.2.0.

Looks like error occurs during some cleanup of resources, but not sure how to avoid it. 

Any idea what could be causing this error?

```

java.lang.RuntimeException: 
  at android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5602)
  at android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:5641)
  at android.app.servertransaction.DestroyActivityItem.execute (DestroyActivityItem.java:44)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2307)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:246)
  at android.app.ActivityThread.main (ActivityThread.java:8506)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)
Caused by: java.lang.NullPointerException: 
  at io.flutter.plugins.googlemaps.GoogleMapController.setGoogleMapListener (GoogleMapController.java:2)
  at io.flutter.plugins.googlemaps.GoogleMapController.dispose (GoogleMapController.java:14)
  at io.flutter.plugin.platform.VirtualDisplayController.dispose (VirtualDisplayController.java:16)
  at io.flutter.plugin.platform.PlatformViewsController.flushAllViews (PlatformViewsController.java:22)
  at io.flutter.plugin.platform.PlatformViewsController.onDetachedFromJNI (PlatformViewsController.java)
  at io.flutter.embedding.engine.FlutterEngine.destroy (FlutterEngine.java:36)
  at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach (FlutterActivityAndFragmentDelegate.java:90)
  at io.flutter.embedding.android.FlutterActivity.release (FlutterActivity.java:7)
  at io.flutter.embedding.android.FlutterActivity.onDestroy (FlutterActivity.java:11)
  at android.app.Activity.performDestroy (Activity.java:8459)
  at android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1344)
  at android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5587)
  at android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:5641)
  at android.app.servertransaction.DestroyActivityItem.execute (DestroyActivityItem.java:44)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2307)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:246)
  at android.app.ActivityThread.main (ActivityThread.java:8506)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)
```