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

crash on iphone 15 pro, MTLTextureDescriptor has width of zero.

Open starpower1m opened this issue 1 year ago • 9 comments

version: mapbox_maps_flutter: ^0.5.1

-[MTLTextureDescriptorInternal validateWithDevice:] > -[MTLTextureDescriptorInternal validateWithDevice:]:1357: failed assertion `Texture Descriptor Validation MTLTextureDescriptor has width of zero. MTLTextureDescriptor has height of zero. '

d: failed assertion `%s' error > Texture Descriptor Validation MTLTextureDescriptor has width of zero. MTLTextureDescriptor has height of zero.


my code

Widget mapWidget() {
    var mapboxMap = MapWidget(
        cameraOptions: CameraOptions(
            center: Point(coordinates: Position(74.0060, 40.7128)).toJson(),
            zoom: 12.0),
        styleUri: "mapbox://styles/hzfanfei/clp6vni1d00hf01pwaheqb076",
        onMapCreated: _onMapCreated,
    );
    return mapboxMap;
}

_onMapCreated(MapboxMap mapboxMap) {
    this.mapboxMap = mapboxMap;

    mapboxMap.scaleBar.updateSettings(ScaleBarSettings(
      position: OrnamentPosition.TOP_LEFT,
      enabled: false,
      marginBottom: 20,
      marginLeft: 10,
      marginTop: 10,
      marginRight: 20,
    ));
  }

starpower1m avatar Jan 22 '24 08:01 starpower1m

Could you check if this is reproducible with 1.0.0-beta.2 ?

baleboy avatar Jan 22 '24 14:01 baleboy

^0.5.1 and 1.0.0-beta.2 All have problems . I later used SizeBox to fix the size, but it still crashed . iPhone x is ok

Center(
  child: SizedBox(
  width: MediaQuery.of(context).size.width,
  height: MediaQuery.of(context).size.height,
  child: mapWidget()),
),
image image

starpower1m avatar Jan 22 '24 18:01 starpower1m

@starpower1m Could you post the full listing of your widget(hosting the MapWidget)? I tried squeezing the map widget to zero size to no avail reproducing this crash.

evil159 avatar Jan 23 '24 08:01 evil159

I wrote a demo that crashes when run on iPhone 14 pro or iPhone 15 pro. iPhone XR is ok. https://github.com/hzfanfei/mapboxTest

hzfanfei avatar Feb 01 '24 11:02 hzfanfei

@hzfanfei Thank you for providing the sample project! I cannot reproduce the crash on my iPhone 13 Pro Max with iOS 17.2.1 with your project, what OS version do you have? And what flutter version do you have? Can you try upgrading to the latest version(3.16.9).

evil159 avatar Feb 01 '24 11:02 evil159

[✓] Flutter (Channel stable, 3.16.1, on macOS 14.1.1 23B81 darwin-arm64, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.2) [✓] VS Code (version 1.85.0) [!] Proxy Configuration ! NO_PROXY is not set [✓] Connected device (5 available) ! Error: Browsing on the local area network for Family的iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resources

! Doctor found issues in 1 category.

hzfanfei avatar Feb 01 '24 13:02 hzfanfei

I also tested this on iPhone 15 Pro and it worked

baleboy avatar Feb 01 '24 13:02 baleboy

I also tested this on iPhone 15 Pro and it worked

Which version of flutter are you using?

hzfanfei avatar Feb 01 '24 13:02 hzfanfei

I have upgraded to flutter 3.16.9 The first time I installed it it was fine, but after a few starts it crashed. You can try to run it a few more times. I crashed after about five attempts. image

hzfanfei avatar Feb 01 '24 15:02 hzfanfei