Mapbox:libc ++ abi.dylib:以NSException(lldb)类型的未捕获异常终止

编程入门 行业动态 更新时间:2024-10-07 12:19:40
本文介绍了Mapbox:libc ++ abi.dylib:以NSException(lldb)类型的未捕获异常终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在Android上工作时一直在执行Mapbox,通过CocoaPods安装后在iOS上出现错误...我得到了framework not found Mapbox,但是在目标会覆盖FRAMEWORK_SEARCH_PATHS构建设置有关将$(继承)添加到可解决此问题的框架搜索路径中,关注与libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

有关的构建问题

我的Podfile如下:

# Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'clustr' do # Flexbox Layout Manager Used By React Natve pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec' # React Native pod 'React', path: '../node_modules/react-native', subspecs: [ # Comment out any unneeded subspecs to reduce bundle size. 'Core', 'DevSupport', 'RCTActionSheet', 'RCTAnimation', 'RCTBlob', 'RCTCameraRoll', 'RCTGeolocation', 'RCTImage', 'RCTNetwork', 'RCTPushNotification', 'RCTSettings', 'RCTTest', 'RCTText', 'RCTVibration', 'RCTWebSocket', 'RCTLinkingIOS' ] # Mapbox pod 'react-native-mapbox-gl', :path => '../node_modules/@mapbox/react-native-mapbox-gl' pod 'Stripe', '~> 10.1.0' inherit! :search_paths end After running the build successfully, and after adding the following Mapbox snippet of code and the rest to get a basic mapbox preview <MapboxGL.MapView ref={map => { this._map = map }} animated={true} showUserLocation={true} userTrackingMode={MapboxGL.UserTrackingModes.Follow} styleURL={this.state.Street} style={Styles.Map.map} centerCoordinate={[this.props.region.longitude, this.props.region.latitude]} attributionEnabled={false} logoEnabled={false} compassEnabled={true} onRegionWillChange={this.handleRegionChange}>

{

控制台出现错误

libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

再看一下日志

objc[20673]: Class MPExportableArtworkProperties is implemented in both /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/MediaPlaybackCore.framework/MediaPlaybackCore (0x12a56aff0) and /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MediaPlayer.framework/MediaPlayer (0x129264348). One of the two will be used. Which one is undefined. objc[20673]: Class SMCalloutView is implemented in both /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/Frameworks/Mapbox.framework/Mapbox (0x110a1b068) and /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/clustr (0x10e852e10). One of the two will be used. Which one is undefined. objc[20673]: Class SMCalloutMaskedBackgroundView is implemented in both /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/Frameworks/Mapbox.framework/Mapbox (0x110a1b090) and /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/clustr (0x10e852e38). One of the two will be used. Which one is undefined. objc[20673]: Class SMCalloutBackgroundView is implemented in both /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/Frameworks/Mapbox.framework/Mapbox (0x110a1b0e0) and /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/clustr (0x10e852e88). One of the two will be used. Which one is undefined.

非常感谢!

解决方案

好的,开始吧...

我没有清楚阅读有关MapView属性用法的文档,因此我正在定义attributionEnabled={false},但是我没有遵循这些简单的说明,所以这就是我获得libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)的全部原因 Enable/Disable attribution on map. For iOS you need to add MGLMapboxMetricsEnabledSettingShownInApp=YES to your Info.plist

在 github /mapbox/react-native-mapbox-gl/blob/master/docs/MapView.md

I've been implementing Mapbox as whilst working on Android, I get errors on iOS after installing via CocoaPods ... I was getting framework not found Mapbox but after Following an answer over at target overrides the FRAMEWORK_SEARCH_PATHS build settings about adding $(inherited) to framework search paths that resolved it but then there were following issues on build relating to libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

My podfile is as follows:

# Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'clustr' do # Flexbox Layout Manager Used By React Natve pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec' # React Native pod 'React', path: '../node_modules/react-native', subspecs: [ # Comment out any unneeded subspecs to reduce bundle size. 'Core', 'DevSupport', 'RCTActionSheet', 'RCTAnimation', 'RCTBlob', 'RCTCameraRoll', 'RCTGeolocation', 'RCTImage', 'RCTNetwork', 'RCTPushNotification', 'RCTSettings', 'RCTTest', 'RCTText', 'RCTVibration', 'RCTWebSocket', 'RCTLinkingIOS' ] # Mapbox pod 'react-native-mapbox-gl', :path => '../node_modules/@mapbox/react-native-mapbox-gl' pod 'Stripe', '~> 10.1.0' inherit! :search_paths end After running the build successfully, and after adding the following Mapbox snippet of code and the rest to get a basic mapbox preview <MapboxGL.MapView ref={map => { this._map = map }} animated={true} showUserLocation={true} userTrackingMode={MapboxGL.UserTrackingModes.Follow} styleURL={this.state.Street} style={Styles.Map.map} centerCoordinate={[this.props.region.longitude, this.props.region.latitude]} attributionEnabled={false} logoEnabled={false} compassEnabled={true} onRegionWillChange={this.handleRegionChange}>

{

I get an error in the console

libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Looking at the logs further I see

objc[20673]: Class MPExportableArtworkProperties is implemented in both /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/MediaPlaybackCore.framework/MediaPlaybackCore (0x12a56aff0) and /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MediaPlayer.framework/MediaPlayer (0x129264348). One of the two will be used. Which one is undefined. objc[20673]: Class SMCalloutView is implemented in both /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/Frameworks/Mapbox.framework/Mapbox (0x110a1b068) and /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/clustr (0x10e852e10). One of the two will be used. Which one is undefined. objc[20673]: Class SMCalloutMaskedBackgroundView is implemented in both /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/Frameworks/Mapbox.framework/Mapbox (0x110a1b090) and /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/clustr (0x10e852e38). One of the two will be used. Which one is undefined. objc[20673]: Class SMCalloutBackgroundView is implemented in both /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/Frameworks/Mapbox.framework/Mapbox (0x110a1b0e0) and /Users/michaelstokes/Library/Developer/CoreSimulator/Devices/1F3A665E-E9A9-48C3-90ED-50C1E9C48DA3/data/Containers/Bundle/Application/368D9223-62FC-4D50-B28C-E6EE1E3D6AB5/clustr.app/clustr (0x10e852e88). One of the two will be used. Which one is undefined.

Thanks very much!

解决方案

Okay, here goes ...

I hadn't read the docs clearly for MapView attribute usage so I was defining attributionEnabled={false} but I hadn't followed these simple instructions, and so that was the whole reason why I was getting libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Enable/Disable attribution on map. For iOS you need to add MGLMapboxMetricsEnabledSettingShownInApp=YES to your Info.plist

Over at github/mapbox/react-native-mapbox-gl/blob/master/docs/MapView.md

更多推荐

Mapbox:libc ++ abi.dylib:以NSException(lldb)类型的未捕获异常终止

本文发布于:2023-11-26 19:12:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634839.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:异常   类型   abi   libc   Mapbox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!