mapbox-maps-android
mapbox-maps-android copied to clipboard
Type is not supported warning
Environment
- Android OS version: 9
- Devices affected: Samsung Galaxy S8
- Maps SDK Version: 10.16.0
Observed behavior and steps to reproduce
While using a mapview inside a fragment with location puck, the following warning with MapBox tag keeps appearing:
W [Type is not supported: android.location.Location]: ValueUtils
Expected behavior
It should not appear
Notes / preliminary analysis
Was unable to find the source of the warning in the source files
Additional links and references
Hey @aayaffe, does the location indicator work fine for you? Could you share the specific code that triggers the issue in the log?
The location puck is not moving in real-time but only on one of two devices I am testing on. This happens on a Samsung Galaxy S8 phone but not on an Oukitel RT3 Tablet. The warning also only appears on the Samsung phone.
The code in question:
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View {
_binding = FragmentMainBinding.inflate(inflater, container, false)
val view = binding.root
createMapIconBitmaps()
annotationApi = mapView.annotations
pointAnnotationManager = annotationApi?.createPointAnnotationManager()
mapView.getMapboxMap().loadStyleUri(
"mapbox://styles/...."
) {
mapView.scalebar.updateSettings { isMetricUnits = true }
mapView.gestures.rotateEnabled = false
nextWpt = sharedPreferences.getInt(SettingsFragment.KEY_NEXT_WPT, -1)
sharedPreferences.getString(SettingsFragment.KEY_ROUTE, null)?.let {
route = parseRoute(sharedPreferences)
addRouteWaypoints(route, nextWpt)
initLocationComponent()
}
}
return view
}
private fun initLocationComponent() {
val locationComponentPlugin = mapView.location
locationComponentPlugin.updateSettings {
this.enabled = true
this.locationPuck = LocationPuck2D(
bearingImage = AppCompatResources.getDrawable(
requireContext(),
R.drawable.user_puck,
),
scaleExpression = interpolate {
linear()
zoom()
stop {
literal(0.0)
literal(0.6)
}
stop {
literal(20.0)
literal(1.0)
}
}.toJson()
)
}
}
This is caused by Location extras having another Location in it. Happens in 'LocationServiceUtils'(mapbox 10.12.1)
Has anybody been able to solve this issue?