【问题标题】:Crash on iOS-SimulatoriOS模拟器崩溃
【发布时间】:2020-07-05 19:16:12
【问题描述】:

点击 Flutter ios 模拟器右上角的位置按钮后,应用程序会自动关闭。

设备:iOS 模拟器(iPhone 11 Pro)。

这是终端上显示的内容。

Lost connection to device.
*** First throw call stack:
(
        0   CoreFoundation                      0x00007fff23e6aefe __exceptionPreprocess + 350
        1   libobjc.A.dylib                     0x00007fff515339b2 objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff23e6ad3c +[NSException raise:format:] + 188
        3   location                            0x000000010384f88a -[LocationPlugin requestPermission] + 426
        4   location                            0x000000010384ef18 -[LocationPlugin handleMethodCall:result:] + 2072
        5   Flutter                             0x0000000101332b1f __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 104
        6   Flutter                             0x00000001012c1762 _ZNK7flutter21PlatformMessageRouter21HandlePlatformMess<…>

【问题讨论】:

    标签: ios flutter


    【解决方案1】:

    崩溃显示[LocationPlugin requestPermission],这是因为您没有将位置权限添加到 info.plist。

    要解决这个问题,您需要 将位置权限添加到您的 info.plist

    <key>NSLocationWhenInUseUsageDescription</key>
    <string>When in use permissions</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>always permissions</string>
    <key>NSLocationAlwaysAndWhenInUsageDescription</key>
    <string>Always and in usage permissions</string>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-28
      • 1970-01-01
      • 1970-01-01
      • 2021-08-27
      • 2011-12-09
      • 2013-09-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多