mapbox-maps-android icon indicating copy to clipboard operation
mapbox-maps-android copied to clipboard

Type is not supported warning

Open aayaffe opened this issue 1 year ago • 4 comments

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

aayaffe avatar Sep 16 '23 16:09 aayaffe

Hey @aayaffe, does the location indicator work fine for you? Could you share the specific code that triggers the issue in the log?

yunikkk avatar Sep 22 '23 14:09 yunikkk

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()
          )
      }
  }

aayaffe avatar Sep 25 '23 08:09 aayaffe

This is caused by Location extras having another Location in it. Happens in 'LocationServiceUtils'(mapbox 10.12.1) image

Dkhusainov avatar Nov 01 '23 07:11 Dkhusainov

Has anybody been able to solve this issue?

Logstor avatar Jan 09 '24 15:01 Logstor