You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today we bind java.util.SortedMap as Android.Runtime.JavaDictionary so it feels more like using .NET types. However, JavaDictionary does not implement ISortedMap, causing this error when attempting to use the type at runtime:
JNI ERROR (app bug): attempt to pass an instance of java.util.HashMap as argument 1 to void org.osmdroid.views.overlay.advancedpolyline.ColorMappingRanges.<init>(java.util.SortedMap)
To fix this we will need to create something like JavaSortedDictionary and map it to java.util.SortedMap.
Workaround
To work around this, the generated member can be deleted via metadata and manually bound to a type which implements SortedMap (TreeMap) with an Addition.
For example, here is a constructor that takes a java.util.SortedMap:
Today we bind
java.util.SortedMap
asAndroid.Runtime.JavaDictionary
so it feels more like using .NET types. However,JavaDictionary
does not implementISortedMap
, causing this error when attempting to use the type at runtime:Code specifying this conversion:
https://github.com/xamarin/java.interop/blob/master/tools/generator/Java.Interop.Tools.Generator.ObjectModel/Symbols/SymbolTable.cs#L212
To fix this we will need to create something like
JavaSortedDictionary
and map it tojava.util.SortedMap
.Workaround
To work around this, the generated member can be deleted via
metadata
and manually bound to a type which implementsSortedMap
(TreeMap
) with anAddition
.For example, here is a constructor that takes a
java.util.SortedMap
:The text was updated successfully, but these errors were encountered: