mapbox / mapbox-maps-flutter

Interactive, thoroughly customizable maps for Flutter powered by Mapbox Maps SDK
https://www.mapbox.com/mobile-maps-sdk
Other
297 stars 122 forks source link

When i use "scaleExpression" inside LocationPuck2D it crashed in iOS device and works well with Android. #320

Open kaun9144 opened 11 months ago

kaun9144 commented 11 months ago

Below is my code snippet which i am using to get location update in app. Initially i wasn't able to adjust location pin size but later i found that if i give some value as a String to "scaleExpression" it changes the size of pin. But it works only on android devices. On iOS device app gets crash with error().

This is code which i am using in my app. mapboxMap.location.updateSettings(LocationComponentSettings( enabled: true, // puckBearingEnabled: true, puckBearingSource: PuckBearingSource.COURSE, locationPuck: LocationPuck( locationPuck2D: LocationPuck2D( bearingImage: null, shadowImage: null, topImage: list, scaleExpression: '2')), ));

This is Error msg getting while app crash on iOS Device.

mapbox_maps_flutter/LocationController.swift:75: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a number instead.", underlyingError: nil)) mapbox_maps_flutter/LocationController.swift:75: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a number instead.", underlyingError: nil)) thread #1, queue = 'com.apple.main-thread', stop reason = Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a number instead.", underlyingError: nil)) frame #0: 0x0000000186a9bebc libswiftCore.dylib_swift_runtime_on_report libswiftCore.dylib: -> 0x186a9bebc <+0>: ret libswiftCore.dylib: 0x186a9bec0 <+0>: b 0x186a9bebc ; _swift_runtime_on_report libswiftCore.dylib: 0x186a9bec4 <+0>: adrp x8, 462002 0x186a9bec8 <+4>: ldrb w0, [x8, #0x2cc] Target 0: (Runner) stopped.

ailic88 commented 9 months ago

Any update here?

kaun9144 commented 9 months ago

Any update here?

Still same issue , not found any solution