You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
pod 'MapboxGL'
My view controller:
import UIKit
import MapboxGL
class MapViewController : UIViewController, MGLMapViewDelegate {
override func viewDidLoad() {
super.viewDidLoad()
let mapView = MGLMapView(frame: view.bounds)
mapView.autoresizingMask = [UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleHeight]
// set the map's center coordinate
mapView.setCenterCoordinate(CLLocationCoordinate2D(latitude: 40.7326808,
longitude: -73.9843407),
zoomLevel: 12, animated: false)
view.addSubview(mapView)
}
}
Error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_MGLMapView", referenced from:
type metadata accessor for ObjectiveC.MGLMapView in MapViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hi @danielgomezrico, this is a duplicate of #1849, which is caused by the new version of CocoaPods. Please add -ObjC to the OTHER_LDFLAGS (Other Linker Flags) build setting of your application target.
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_MGLMapView", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Same problem using Xcode 6.4 and CocoaPods 0.38.2. I checked all of the linker flags, and -ObjC is there. Simply have pod 'MapboxGL' in Podfile so assuming that is latest version
It sounds like CocoaPods has failed to set up the workspace correctly, but the same version of CocoaPods works for me. @wangqianjun and @AndrewBarba, please try installing Mapbox GL into a brand-new project. If it still exibits this issue, please ZIP up the project (podspec and all) and send it to [email protected], referencing this GitHub issue. Thank you!
Before I actually do that, you guys have use_frameworks! listed in Podfile but also have min platform as iOS 7.0. Everything I'm reading says that is not possible. 7.0 doesn't support frameworks so I'm not sure how anyone got that to work. Regardless I tried it with and without that line on both min targets of iOS 7 and iOS 8 and could not get it to build. With that line on a min target of iOS 7 pretty much everything blew up, on iOS 8 the Facebook SDK was having problems, I fixed those with build settings but then same error with Mapbox.
@AndrewBarba, using a dynamic framework is required if you use Swift, as the others on this page appear to be doing, because Swift code cannot link against static libraries. It is possible to run an application linked against frameworks on iOS 7; Xcode issues a warning, but that appears to be a bug in Xcode.
Are you getting exactly the same linker error as the original reporter, or something different?
Sorry to be completely spitballing here (DF reader, really want to use this) but your podspec is using m.xcconfig which isn't listed in Pod docs. Have you looked at using:
I stand corrected. But CocoaPods/swift#9 (comment) is pretty much spot on. In fact, the main benefit we’ve gotten from CocoaPods has been its ability to wrap the static library in a dynamic framework (something we’ve been planning to roll at home for #828). However, if you’re running into the validation issue because you’re backwards-deploying to iOS 7.0, you may want to consider the manual installation route, unless you’re using CocoaPods for any other packages.
your podspec is using m.xcconfig which isn't listed in Pod docs
Looks like our use of xcconfig dates back to cutting-room-floor/mapbox-gl-cocoa@906a1bb. pod_target_xcconfig and compiler_flags only replaced xcconfig quite recently in CocoaPods/CocoaPods#3573 in 0.38.0. I’ve opened #2132 to move over to the new flag, though I don’t know if we want to require the newest CocoaPods version so soon. Besides the Facebook SDK, what other CocoaPods packages are you using in your project?
Activity
1ec5 commentedon Jul 10, 2015
Hi @danielgomezrico, this is a duplicate of #1849, which is caused by the new version of CocoaPods. Please add
-ObjCto theOTHER_LDFLAGS(Other Linker Flags) build setting of your application target.danielgomezrico commentedon Jul 10, 2015
@1ec5 But I have it...
friedbunny commentedon Jul 10, 2015
In that case, @danielgomezrico, you should try the voodoo dance of ⌘⇧K (CMD+SHIFT+K) and ⌘⌥⇧K (CMD+OPTION+SHIFT+K) to clean everything out.
1ec5 commentedon Jul 10, 2015
You may also need to mark Pods.framework as optional instead of required in the General tab.
1ec5 commentedon Jul 10, 2015
Oh, sorry, I had the workaround slightly wrong. Please see this comment for the real workaround: #1862 (comment).
wangqianjun commentedon Jul 29, 2015
I have the same problem:
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_MGLMapView", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Xcode 6.4
OSX Yosemite 10.10.4
Now what should I do?
1ec5 commentedon Jul 29, 2015
@wangqianjun, what version of CocoaPods and what version of MapboxGL do you have installed?
AndrewBarba commentedon Aug 18, 2015
Same problem using Xcode 6.4 and CocoaPods 0.38.2. I checked all of the linker flags, and -ObjC is there. Simply have
pod 'MapboxGL'in Podfile so assuming that is latest version1ec5 commentedon Aug 18, 2015
It sounds like CocoaPods has failed to set up the workspace correctly, but the same version of CocoaPods works for me. @wangqianjun and @AndrewBarba, please try installing Mapbox GL into a brand-new project. If it still exibits this issue, please ZIP up the project (podspec and all) and send it to [email protected], referencing this GitHub issue. Thank you!
AndrewBarba commentedon Aug 19, 2015
Before I actually do that, you guys have
use_frameworks!listed in Podfile but also have min platform as iOS 7.0. Everything I'm reading says that is not possible. 7.0 doesn't support frameworks so I'm not sure how anyone got that to work. Regardless I tried it with and without that line on both min targets of iOS 7 and iOS 8 and could not get it to build. With that line on a min target of iOS 7 pretty much everything blew up, on iOS 8 the Facebook SDK was having problems, I fixed those with build settings but then same error with Mapbox.1ec5 commentedon Aug 19, 2015
@AndrewBarba, using a dynamic framework is required if you use Swift, as the others on this page appear to be doing, because Swift code cannot link against static libraries. It is possible to run an application linked against frameworks on iOS 7; Xcode issues a warning, but that appears to be a bug in Xcode.
Are you getting exactly the same linker error as the original reporter, or something different?
AndrewBarba commentedon Aug 19, 2015
Exact same error.
AndrewBarba commentedon Aug 19, 2015
Sorry to be completely spitballing here (DF reader, really want to use this) but your podspec is using
m.xcconfigwhich isn't listed in Pod docs. Have you looked at using:Replaced deprecated podspec flag
1ec5 commentedon Aug 19, 2015
I stand corrected. But CocoaPods/swift#9 (comment) is pretty much spot on. In fact, the main benefit we’ve gotten from CocoaPods has been its ability to wrap the static library in a dynamic framework (something we’ve been planning to roll at home for #828). However, if you’re running into the validation issue because you’re backwards-deploying to iOS 7.0, you may want to consider the manual installation route, unless you’re using CocoaPods for any other packages.
Looks like our use of
xcconfigdates back to cutting-room-floor/mapbox-gl-cocoa@906a1bb.pod_target_xcconfigandcompiler_flagsonly replacedxcconfigquite recently in CocoaPods/CocoaPods#3573 in 0.38.0. I’ve opened #2132 to move over to the new flag, though I don’t know if we want to require the newest CocoaPods version so soon. Besides the Facebook SDK, what other CocoaPods packages are you using in your project?AndrewBarba commentedon Aug 20, 2015
We're using quite a few
And
TLKit, which is our private pod, uses:Replaced deprecated podspec flag
[iOS] Replaced deprecated podspec flag