Error customizing a google maps marker

2

I thus define the marker with an asset vector taken from the library of the Android Studio itself.

mMap.addMarker(new MarkerOptions()
               .position(agentepos)
               .title("Agente " + agentes.getMovil())
               .snippet(PhoneNumberUtils.formatNumber(agentes.getMovil()))
               .snippet(agentes.getMovil())
               .icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_delivery_truck)));

And I get this error:

  

com.google.maps.api.android.lib6.common.apiexception.b: Failed to decode image. The provided image must be to Bitmap.   Which directly affects this line of code.

If I use the marker by default it works correctly. Possible solutions please?

Update: If I use a .png it works without problems

    
asked by Axel Telkamper 03.05.2018 в 23:04
source

0 answers