3

I'm installing Mixpanel right know (NOT using CocoaPods due to bigger problems) and I've got this problem once I try to build. Apparently it's in the linking progress:

Ld /Users/zheref/Library/Developer/Xcode/DerivedData/Skillet-gyrvrgajwggdcmhhtxflcerwovjx/Build/Products/Debug-iphonesimulator/Skillet.app/Skillet normal x86_64
cd /Users/zheref/Code/skillet/skillet-ios
export IPHONEOS_DEPLOYMENT_TARGET=8.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -L/Users/zheref/Library/Developer/Xcode/DerivedData/Skillet-gyrvrgajwggdcmhhtxflcerwovjx/Build/Products/Debug-iphonesimulator -L/Users/zheref/Code/skillet/skillet-ios/Pods/Brightcove-Player-SDK/Library -L/Users/zheref/Code/skillet/skillet-ios/Pods/Google/Libraries -L/Users/zheref/Code/skillet/skillet-ios/Pods/GoogleAppUtilities/Libraries -L/Users/zheref/Code/skillet/skillet-ios/Pods/GoogleAuthUtilities/Libraries -L/Users/zheref/Code/skillet/skillet-ios/Pods/GoogleNetworkingUtilities/Libraries -L/Users/zheref/Code/skillet/skillet-ios/Pods/GoogleSignIn/Libraries -L/Users/zheref/Code/skillet/skillet-ios/Pods/GoogleSymbolUtilities/Libraries -L/Users/zheref/Code/skillet/skillet-ios/Pods/GoogleUtilities/Libraries -L/Users/zheref/Code/skillet/skillet-ios/Skillet -F/Users/zheref/Library/Developer/Xcode/DerivedData/Skillet-gyrvrgajwggdcmhhtxflcerwovjx/Build/Products/Debug-iphonesimulator -F/Users/zheref/Code/skillet/skillet-ios -F/Users/zheref/Code/vendors/parse-library-1.7.5 -filelist /Users/zheref/Library/Developer/Xcode/DerivedData/Skillet-gyrvrgajwggdcmhhtxflcerwovjx/Build/Intermediates/Skillet.build/Debug-iphonesimulator/Skillet.build/Objects-normal/x86_64/Skillet.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lBCOVPlayerSDK -lGGLCore -lGGLSignIn -lGSDK_Overload -lGTMOAuth2_external -lGTMOAuth2_internal -lGTMSessionFetcher_core -lGTMSessionFetcher_full -lGTMStackTrace -lGTM_AddressBook -lGTM_DebugUtils -lGTM_GTMURLBuilder -lGTM_KVO -lGTM_NSDictionary+URLArguments -lGTM_NSScannerJSON -lGTM_NSStringHTML -lGTM_NSStringXML -lGTM_Regex -lGTM_RoundedRectPath -lGTM_StringEncoding -lGTM_SystemVersion -lGTM_UIFont+LineHeight -lGTM_core -lGTM_iPhone -lOpenInChrome -lPods-PaymentKit -lPods-Stripe -lSignIn -framework AVFoundation -framework AddressBook -framework CoreMedia -framework CoreText -framework Foundation -framework MediaPlayer -framework Security -framework StoreKit -framework SystemConfiguration -ObjC -lBCOVPlayerSDK -lGGLCore -lGGLSignIn -lGSDK_Overload -lGTMOAuth2_external -lGTMOAuth2_internal -lGTMSessionFetcher_core -lGTMSessionFetcher_full -lGTMStackTrace -lGTM_AddressBook -lGTM_DebugUtils -lGTM_GTMURLBuilder -lGTM_KVO -lGTM_NSDictionary+URLArguments -lGTM_NSScannerJSON -lGTM_NSStringHTML -lGTM_NSStringXML -lGTM_Regex -lGTM_RoundedRectPath -lGTM_StringEncoding -lGTM_SystemVersion -lGTM_UIFont+LineHeight -lGTM_core -lGTM_iPhone -lOpenInChrome -lPods-PaymentKit -lPods-Stripe -lSignIn -framework AVFoundation -framework AddressBook -framework CoreMedia -framework CoreText -framework Foundation -framework MediaPlayer -framework Security -framework StoreKit -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/zheref/Library/Developer/Xcode/DerivedData/Skillet-gyrvrgajwggdcmhhtxflcerwovjx/Build/Intermediates/Skillet.build/Debug-iphonesimulator/Skillet.build/Objects-normal/x86_64/Skillet.swiftmodule -mios-simulator-version-min=8.1 -licucore -framework QuartzCore -framework CoreGraphics -framework Accelerate -framework CoreTelephony -framework SystemConfiguration -framework Foundation -framework UIKit -framework Bolts -framework Social -framework Accounts -framework Crashlytics -framework AVFoundation -framework CoreMedia -framework Parse -framework CoreText -framework MediaAccessibility -framework MediaPlayer -framework CFNetwork -framework Security -framework AudioToolbox -framework CoreLocation -lsqlite3 -lz -framework MobileCoreServices -framework StoreKit -framework FBSDKShareKit -framework Fabric -framework FBSDKCoreKit -framework FBSDKLoginKit -lPods -Xlinker -dependency_info -Xlinker /Users/zheref/Library/Developer/Xcode/DerivedData/Skillet-gyrvrgajwggdcmhhtxflcerwovjx/Build/Intermediates/Skillet.build/Debug-iphonesimulator/Skillet.build/Objects-normal/x86_64/Skillet_dependency_info.dat -o /Users/zheref/Library/Developer/Xcode/DerivedData/Skillet-gyrvrgajwggdcmhhtxflcerwovjx/Build/Products/Debug-iphonesimulator/Skillet.app/Skillet

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Mixpanel", referenced from:
  __TMaCSo8Mixpanel in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm using Swift language (NOT Objective-C at all).

Thanks in advance.

UPDATE 1

The problem appears when I put the line: Mixpanel.sharedInstanceWithToken(MIXPANEL_TOKEN); and not before.

There is no problem when I install the Mixpanel code inside the project and not even when I import it from the Bridging Header.

  • Even if you are not using objective-c for your code, that particular library IS written in it. I am not sure if you have to create bridge header for this particular case. Take a look at : http://stackoverflow.com/questions/28016246/mixpanel-does-not-work-with-swift and https://medium.com/ios-os-x-development/how-to-implement-mixpanel-into-your-swift-app-in-5-minutes-xcode-6-3-19263621c13b. Also, take a look at this one : https://github.com/soffes/Mixpanel – Miknash Sep 02 '15 at 21:22
  • 1
    It doesn't seem to be problem with the bridging file. When I import it from the bridging header it brings no problem. The problem begins when I put the line ```Mixpanel.sharedInstanceWithToken(MIXPANEL_TOKEN);``` – Sergio Daniel L. García Sep 02 '15 at 21:54
  • what problems do you have with cocoapods? I use them in all my projects and never had an issue. In this case, make sure that the library files are included on the target you are compiling. – Duck Sep 03 '15 at 07:26
  • yes i have same issue....may i know how you haqve resolved this one? – Bhoomi Jagani Nov 03 '15 at 07:17
  • Did you import the framework into that class? Probably import Mixpanel at the top of the class? – bolnad Dec 30 '15 at 17:30

1 Answers1

7

I had same issue, I just tried by re-adding the framework files by dragging into my project separately.

Like:

Don't drag folder directly instead drag only files into your project.

Also don't forget to link frameworks

SystemConfiguration, CoreTelephony, Accelerate, Security, CFNetwork, QuartzCore, libicucore.tbd

Suhas Arvind Patil
  • 1,732
  • 1
  • 19
  • 31
  • This procedure worked for me, and I might add that I created a group for the files, then copied the files. Regarding the Frameworks, some of these were not listed in the docs, and I added the frameworks one by one trying to build, and I was successful only after I added the last one: libicucore.tbd – bitsand Mar 26 '16 at 23:57
  • 1
    I can confirm and add 1 more tibit. When I dragged the folder in, the folder was blue. However when I made a new group and instead dragged the files in, the folder was yellow (like all the others). So if you have a blue folder for mixpanel it probly means you dragged the folder in and thats the cause of this weird linker error. – Aggressor Mar 28 '16 at 16:32
  • Also I just noticed in my version control that the pbxproj file hadn't changed until I added the files manually. So what I think that means when the folder was added it wasn't getting linked to the main pbxproj but dragging over the files manually actually does create that link (so you can verify this issue by looking at whether or not your pbxproj file had actually changed when you added the mixpanel files) – Aggressor Mar 28 '16 at 16:35
  • @Aggressor: yeah, right that's how we can verify this. – Suhas Arvind Patil Mar 29 '16 at 05:40