Skip to content

NPE using an SVG asset as annotation image #1100

@cohenadair

Description

@cohenadair

I'm using the annotation example here, except replacing the PNG asset with an SVG asset. This yields the below error. Switching to a PNG works as expected. I did verify that the Uint8List being passed to the PointAnnotationOptions is non-empty. I wasn't able to find anything in the documentation that states SVGs aren't supported.

If they're not supported and aren't going to be supported; not a huge deal, but it may be a good idea to document for future users.

I/flutter (20331): PlatformException(NullPointerException, java.lang.NullPointerException: decodeByteArray(...) must not be null, Cause: null, Stacktrace: java.lang.NullPointerException: decodeByteArray(...) must not be null
I/flutter (20331): 	at com.mapbox.maps.mapbox_maps.annotation.PointAnnotationControllerKt.toPointAnnotationOptions(PointAnnotationController.kt:1929)
I/flutter (20331): 	at com.mapbox.maps.mapbox_maps.annotation.PointAnnotationController.createMulti(PointAnnotationController.kt:80)
I/flutter (20331): 	at com.mapbox.maps.mapbox_maps.pigeons._PointAnnotationMessenger$Companion.setUp$lambda$9$lambda$8(PointAnnotationMessenger.kt:1457)
I/flutter (20331): 	at com.mapbox.maps.mapbox_maps.pigeons._PointAnnotationMessenger$Companion.$r8$lambda$rt3NcAMAT4IkVhKMTiKiDu_-Zn0(PointAnnotationMessenger.kt:0)
I/flutter (20331): 	at com.mapbox.maps.mapbox_maps.pigeons._PointAnnotationMessenger$Companion$$ExternalSyntheticLambda97.onMessage(R8$$SyntheticClass:0)
I/flutter (20331): 	at io.flutter.plugin.common.BasicMessageChannel$IncomingMessageHandler.onMessage(BasicMessageChannel.java:261)
I/flutter (20331): 	at io.flutter.embedding.engine.dart.DartMess
I/flutter (20331): #0      _PointAnnotationMessenger.createMulti (package:mapbox_maps_flutter/src/pigeons/point_annotation_messenger.dart:1206:7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions