Update: can not remove markerCluster instance if you build your app with Java1.7
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.2.6-beta-20180226-1500" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="2.2.6-beta-20180226-1541" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="BaseClass" src="www/BaseClass.js">
<runs />

MODIFY
src/android/plugin/google/maps/MyPlugin.java
src/android/plugin/google/maps/MyPlugin.java
@@ -23,13 +23,14 @@ import org.json.JSONException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class MyPlugin extends CordovaPlugin implements MyPluginInterface {
public MyPlugin self = null;
- public final ConcurrentHashMap<String, Method> methods = new ConcurrentHashMap<String, Method>();
+ public final Map<String, Method> methods = new ConcurrentHashMap<String, Method>();
protected static ExecutorService executorService = null;
public CordovaGoogleMaps mapCtrl = null;

MODIFY
src/android/plugin/google/maps/PluginMarkerCluster.java
src/android/plugin/google/maps/PluginMarkerCluster.java
@@ -7,7 +7,6 @@ import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.LatLngBounds;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
-import com.google.android.gms.maps.model.Polygon;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
@@ -20,14 +19,14 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.Set;
+import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class PluginMarkerCluster extends PluginMarker {
- private final static ConcurrentHashMap<String, STATUS> pluginMarkers = new ConcurrentHashMap<String, STATUS>();
- private final static ConcurrentHashMap<String, Integer> waitCntManager = new ConcurrentHashMap<String, Integer>();
- private final static ConcurrentHashMap<String, Boolean> debugFlags = new ConcurrentHashMap<String, Boolean>();
+ private final static Map<String, STATUS> pluginMarkers = new ConcurrentHashMap<String, STATUS>();
+ private final static Map<String, Integer> waitCntManager = new ConcurrentHashMap<String, Integer>();
+ private final static Map<String, Boolean> debugFlags = new ConcurrentHashMap<String, Boolean>();
private final static ArrayList<String> deleteMarkers = new ArrayList<String>();
private final Object semaphore = new Object();

Update: can not remove markerCluster instance if you build your app with Java1.7 (#2093)