mapbox / mapbox/mapbox-maps-flutter
When i use "scaleExpression" inside LocationPuck2D it crashed in iOS device and works well with Android.
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Dart
- Sterne
- 380
- Forks
- 204
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array 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, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array 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, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array 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.`
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der bereitgestellten Flutter-Reproduktion und verfolge scaleExpression von LocationPuck2D bis zu LocationController.swift:75, wo der iOS-Dekodierungsfehler gemeldet wird. Vergleiche, wie der Wert auf Android und iOS verarbeitet wird; abgeschlossen ist die Aufgabe, wenn die Einstellung auf einem iOS-Gerät nicht mehr abstürzt, während das Verhalten auf Android intakt bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- dart, flutter, swift
- Bereich
- mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 35/100