【问题标题】:google_maps_flutter crashes on ios device with the error "-[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x2808f4380"google_maps_flutter 在 iOS 设备上崩溃并出现错误“-[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x2808f4380\”
【发布时间】:2023-01-25 05:10:24
【问题描述】:

我正在运行 google_maps_flutter 2.1.0 和 flutter 2.10.3。打开地图时,应用程序崩溃并显示以下错误日志。任何人都可以指出问题的确切位置。 位置访问权限也已正确授予。当 flutter 版本为 2.8.0 时,它已经工作了一段时间。

-[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x2808f4380
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x2808f4380'
*** First throw call stack:
(0x181955d3c 0x198ccf6a8 0x181a25768 0x1818eff6c 0x1818ef1dc 0x100571b80 0x1816221a8 0x1815c3474 0x100571b18 0x1005724e8 0x1004631b8 0x100461514 0x100460778 0x10045f43c 0x10045e410 0x10044af9c 0x100413bac 0x100412f30 0x100412d78 0x100412b58 0x100acfb10 0x100acf948 0x103f0eb6c 0x10440275c 0x103f3bc98 0x1042c9b54 0x1041f1160 0x1041f4ec4 0x18196a06c 0x1818f43d8 0x1818ef06c 0x1818cef44 0x1818e1e1c 0x1a1c609a0 0x184115b90 0x183eab16c 0x100401de4 0x101918250)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001bba5d9e8 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1bba5d9e8 <+8>:  b.lo   0x1bba5da04               ; <+36>
    0x1bba5d9ec <+12>: stp    x29, x30, [sp, #-0x10]!
    0x1bba5d9f0 <+16>: mov    x29, sp
    0x1bba5d9f4 <+20>: bl     0x1bba59670               ; cerror_nocancel
 

【问题讨论】:

  • 似乎不是 API 问题。关于错误,你能检查一下this吗?

标签: ios flutter dart google-maps google-maps-flutter


【解决方案1】:

我在这里解决这个问题你可以看到它 https://github.com/flutter/flutter/issues/102204#issuecomment-1103795753

【讨论】:

  • 正如目前所写,您的答案尚不清楚。请edit 添加更多详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写出好的答案的信息in the help center。
【解决方案2】:

我通过在 AppDelegate.swift 中添加以下行解决了这个问题

GMSServices.setMetalRendererEnabled(true)

这必须在任何 GMSServices 调用之前调用,对我来说就在 application() 函数的开头,在 GeneratedPluginRegistrant.register(with: self) 之前

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多