首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS模拟器在单击Map时崩溃

iOS模拟器在单击Map时崩溃
EN

Stack Overflow用户
提问于 2022-01-31 10:35:02
回答 1查看 975关注 0票数 0

所以我有一个问题,只有和iOS的模拟器,我可以和地图交互大约两秒钟,然后整个应用程序崩溃…

当我使用我自己的设备时,它工作得很好.

这里有一个gif:https://gyazo.com/67a5d7f10586d0368eb631346122867b

以下是我的实现:

代码语言:javascript
复制
import React, { useEffect } from "react";
import { StatusBar } from "react-native";
import MapboxGL from "@react-native-mapbox-gl/maps";

function MapScreen() {
    const context = useEquipment();

    // const { deployedEquipment } = context!;

    const defaultCameraCoordinates = {
        latitude: context?.location?.latitude ?? 0,
        longitude: context?.location?.longitude ?? 0,
    };

    return (
        <>
            <StatusBar animated={true} backgroundColor="black" barStyle="dark-content" />
            <MapboxGL.MapView style={styles.map}>
            </MapboxGL.MapView>
        </>
    );
}

来自设备的错误:

特定于

应用程序的信息:NSInvalidArgumentException类型为NSException *终止应用程序的未完全异常的dyld4配置:dyld4终止原因:‘* -__NSPlaceholderArray initWithObjects:count::尝试从名为CoreSimulator 783.5的对象中插入零对象()-设备: iPhone 13 (D63AEBAD-4484-8F91-259 CAEA4FC7F)-运行时: iOS 15.2 (19C51) - DeviceType: iPhone 13

Podfile:

代码语言:javascript
复制
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'DigiCatchRN' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => true
  )

  target 'DigiCatchRNTests' do
    inherit! :complete
    # Pods for testing
  end

  pre_install do |installer|
    $RNMBGL.pre_install(installer) #mapbox
  end


  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)

    $RNMBGL.pre_install(installer) # mapbox
  end
end
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-02-10 14:22:03

我终于找到了解决这个问题的方法,结果我的模拟器运行的是ios 15.2崩溃。当我在这个版本下面下载另一个版本的时候。我的例子是13.5。它终于起作用了:)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70924503

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档