Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ghost opened this issue Dec 11, 2017 · 3 comments
Closed

Comments

@ghost
Copy link

ghost commented Dec 11, 2017

I've been getting this error for a number of days whilst attempting to install and use mapbox Whilst Mapbox works on Android, it does not work on iOS for me consistently resulting in an error on build which is framework not found Mapbox

When installing via CocoaPods I'm getting an error from xcode

framework not found Mapbox

Ld /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/clustr.app/clustr normal x86_64
    cd /Users/michaelstokes/clustr/clustr_app/ios
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk -L/Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator -L/Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/React -L/Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/Stripe -L/Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/react-native-mapbox-gl -L/Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/yoga -F/Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator -F/Users/michaelstokes/Documents/FacebookSDK -filelist /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Intermediates.noindex/Clustr.build/Debug-iphonesimulator/clustr.build/Objects-normal/x86_64/clustr.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.0 -Xlinker -object_path_lto -Xlinker /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Intermediates.noindex/Clustr.build/Debug-iphonesimulator/clustr.build/Objects-normal/x86_64/clustr_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lReact -lStripe -lreact-native-mapbox-gl -lstdc++ -lyoga -framework AddressBook -framework Foundation -framework JavaScriptCore -framework Mapbox -framework PassKit -framework Security -framework WebKit -framework XCTest -weak_framework Contacts -ObjC -lc++ -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Intermediates.noindex/Clustr.build/Debug-iphonesimulator/clustr.build/clustr.app.xcent /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/libReact.a /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/libRCTAnimation.a -framework FBSDKLoginKit /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/libRCTGeolocation.a /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/libRCTImage.a /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/libRCTLinking.a /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/libRCTNetwork.a -framework FBSDKShareKit -framework Bolts /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/libRCTSettings.a /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/libRCTText.a /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/libRCTVibration.a -framework FBSDKCoreKit /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a -lAirMaps -lRNDeviceInfo -lPods-clustr -lRCTCamera -lreact-native-branch -lRNGeocoder -lReact -lyoga -lcxxreact -ljschelpers -lRNVectorIcons -lTPSStripe -Xlinker -dependency_info -Xlinker /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Intermediates.noindex/Clustr.build/Debug-iphonesimulator/clustr.build/Objects-normal/x86_64/clustr_dependency_info.dat -o /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Products/Debug-iphonesimulator/clustr.app/clustr

ld: framework not found Mapbox
clang: error: linker command failed with exit code 1 (use -v to see invocation)
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
When running pod install I get

MacBook-Pro:ios michaelstokes$ pod install
Analyzing dependencies
Fetching podspec for `React` from `../node_modules/react-native`
Fetching podspec for `react-native-mapbox-gl` from `../node_modules/@mapbox/react-native-mapbox-gl`
Fetching podspec for `yoga` from `../node_modules/react-native/ReactCommon/yoga/Yoga.podspec`
Downloading dependencies
Using React (0.50.4)
Using Stripe (10.1.0)
Using react-native-mapbox-gl (6.0.1)
Using yoga (0.50.4.React)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 19 dependencies from the Podfile and 4 total pods installed.

[!] Automatically assigning platform ios with version 8.0 on target clustr because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] The `clustr [Debug]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-clustr/Pods-clustr.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `clustr [Release]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-clustr/Pods-clustr.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

Steps taking so far include:

  • CocoaPods approach with pod install and pod deintegrate results in framework not found Mapbox
  • Manual install results in libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) or framework not found XCTest

Thanks very much!

@ghost
Copy link
Author

ghost commented Dec 16, 2017

Update:

So after getting the following issue after running pod install

MacBook-Pro:clustr_app michaelstokes$ cd ios/ && pod install
Analyzing dependencies
Fetching podspec for `React` from `../node_modules/react-native`
Fetching podspec for `react-native-mapbox-gl` from `../node_modules/@mapbox/react-native-mapbox-gl`
Fetching podspec for `yoga` from `../node_modules/react-native/ReactCommon/yoga/Yoga.podspec`
Downloading dependencies
Installing React (0.50.4)
Using Stripe (10.1.0)
Installing react-native-mapbox-gl (6.0.1)
Installing yoga (0.50.4.React)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 19 dependencies from the Podfile and 4 total pods installed.

[!] Automatically assigning platform ios with version 8.0 on target clustr because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] The `clustr [Debug]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-clustr/Pods-clustr.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `clustr [Release]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-clustr/Pods-clustr.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.


Following an answer over at https://stackoverflow.com/questions/26445784/target-overrides-the-framework-search-paths-build-settings about adding $(inherited) to framework search paths seems to have resolved the issue and now the app builds successfully but if inserting the MapBox mapview

                <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}>
{

An error seems to popup

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

An above log in the console shows

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.

@ghost ghost changed the title framework not found Mapbox iOS Xcode React-Native Ask Question libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) Dec 16, 2017
@ghost
Copy link
Author

ghost commented Dec 19, 2017

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 https://github.com/mapbox/react-native-mapbox-gl/blob/master/docs/MapView.md

@nitaliano
Copy link
Owner

@MichaelStokes glad you got it working, sorry that there's not a better error message being displayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant