Xamarin.Forms.GoogleMaps.Clustering icon indicating copy to clipboard operation
Xamarin.Forms.GoogleMaps.Clustering copied to clipboard

Changing the cluster icon on Android crashes the App

Open coosmiyn opened this issue 4 years ago • 1 comments

VERSIONS

  • Xamarin.Forms.GoogleMaps.Clustering - 1.1.0
  • Xamarin.Forms - 4.8.0.1364
  • Android 10

PLATFORMS

  • [x] Android
  • [ ] iOS

ACTUAL BEHAVIOR

When the pins are clustered with a custom icon the app throws "Java.Lang.IllegalArgumentException - Failed to decode image. The provided image must be a bitmap"

[AndroidRuntime] com.google.maps.api.android.lib6.common.apiexception.b: Failed to decode image. The provided image must be a Bitmap.
[AndroidRuntime] 	at com.google.maps.api.android.lib6.impl.h.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (120408-0):2)
[AndroidRuntime] 	at com.google.maps.api.android.lib6.impl.q.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (120408-0):2)
[AndroidRuntime] 	at com.google.maps.api.android.lib6.impl.cw.<init>(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (120408-0):4)
[AndroidRuntime] 	at com.google.maps.api.android.lib6.impl.bi.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (120408-0):96)
[AndroidRuntime] 	at dd.onTransact(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (120408-0):4)
[AndroidRuntime] 	at android.os.Binder.transact(Binder.java:914)
[AndroidRuntime] 	at com.google.android.gms.internal.maps.zza.zza(Unknown Source:10)
[AndroidRuntime] 	at com.google.android.gms.maps.internal.zzg.addMarker(Unknown Source:54)
[AndroidRuntime] 	at com.google.android.gms.maps.GoogleMap.addMarker(Unknown Source:48)
[AndroidRuntime] 	at com.google.maps.android.MarkerManager$Collection.addMarker(MarkerManager.java:161)
[AndroidRuntime] 	at com.google.maps.android.clustering.view.DefaultClusterRenderer$CreateMarkerTask.perform(DefaultClusterRenderer.java:863)
[AndroidRuntime] 	at com.google.maps.android.clustering.view.DefaultClusterRenderer$CreateMarkerTask.access$2100(DefaultClusterRenderer.java:803)
[AndroidRuntime] 	at com.google.maps.android.clustering.view.DefaultClusterRenderer$MarkerModifier.performNextTask(DefaultClusterRenderer.java:644)
[AndroidRuntime] 	at com.google.maps.android.clustering.view.DefaultClusterRenderer$MarkerModifier.handleMessage(DefaultClusterRenderer.java:613)
[AndroidRuntime] 	at android.os.Handler.dispatchMessage(Handler.java:107)
[AndroidRuntime] 	at android.os.Looper.loop(Looper.java:237)
[AndroidRuntime] 	at android.app.ActivityThread.main(ActivityThread.java:7811)
[AndroidRuntime] 	at java.lang.reflect.Method.invoke(Native Method)
[AndroidRuntime] 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
[AndroidRuntime] 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)

HOW TO REPRODUCE AND/OR EXAMPLE PROJECT

I am trying to set up the icon for the clusters using

MainMap.ClusterOptions.SetRenderUsingImage(BitmapDescriptorFactory.FromBundle("active9"));

I also have the assembly set up and the PlatformConfig. If I don't change the icon everything works as expected, and I can also setup custom icons for the pins on the map, using the same code.

coosmiyn avatar Sep 01 '20 17:09 coosmiyn

I think the solution is simply to not change the cluster icon anymore. Leave it alone.

raduiordache avatar Sep 09 '20 13:09 raduiordache