Swift Cocoapods with Objective-C files gives Undefined symbols - ios

I have encountered the following error message:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_VTapManager", referenced from:
objc-class-ref in VTapManagerHelper.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Have you tried enabling dynamic frameworks? That worked for me.
To do it go to the podfile in your workspace and open it, then:
#Uncomment the next line if you're using Swift or would like to use dynamic frameworks
remove the hash here -> #use_frameworks!

It's minor, but don't forget to quit Xcode and run your yourProject.xcworkspace instead of yourProject.xcodeproj after installing CocoaPods

Related

Failed to install pod: Undefined symbols for architecture x86_64

According to AdMob documentation, in order to integrate with facebook audience network I need to install this pod:
pod 'GoogleMobileAdsMediationFacebook'
When I try to install it, I received an error:
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GADUnifiedNativeAdView", referenced from:
objc-class-ref in FacebookAdapter(GADFBNativeAd.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed
with exit code 1 (use -v to see invocation)
Unfortunately I didn't find a solution for this issue.
Thanks.
I had the same problem. It worked after I deleted an old version of FBAudienceNetwork.framework's path in Framework Search Paths.

Undefined symbols for architecture x86_64 when using Tesseract

I am using tesseract provided by google. After following this tutorial, i finally built finish my app. However, when i run it, i run into the problem of undefined symbols. This is the error
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_G8Tesseract", 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)
How do i fix this issue? I tried searching online but none of the solutions worked for me. I tried reinstalling the pods and updating it. Then i faced this error
clang: error: no such file or directory: '/Users/admin/Desktop/tst/Pods/Target Support Files/Pods-tst/Pods-tst-dummy.m'
clang: error: no input files
When i tried redoing the project i get his error
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_G8Tesseract", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Apparently i had to add the TesseractOCR.framework separately even after using cocoa pods and disable Bitcode. This prevented the errors.
I think you should update pod version:
sudo gem install cocoapods
After this run:
pod update --verbose
Since Tesseract requires libstdc++.6.0.9.dylib (or libstdc++.6.0.9.tbd if libstdc++.6.0.9.dylib is unavailable in your current Xcode version) and CoreImage.framework you’ll need to link both of these libraries in.
In the General tab, scroll down to Linked Frameworks and Libraries.
There should be only one file here: TesseractOCR.framework, which you just added. Click the + button underneath the list. Find both libstdc++.dylib (or libstdc++.6.0.9.tbd) and CoreImage.framework and add them to your project.

VCFloatingButtonAction error

I am getting these two error in my project after importing VCFloatingActionButton
1.
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_VCFloatingActionButton", referenced from:
objc-class-ref in CreateServiceWizardViewController.o
ld: symbol(s) not found for architecture x86_64
2.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If anyone has used this component intheir project, kindly guide me on how to use this component.
Assuming you have used Cocoa pods for VCFloatingButtonAction for intregation, Cocoapods makes a .xcworkspace file after the intregation is complete. If you open you project by normal .xcodeproj file, xcode will not find the framework and give you linker crash.
Open the project with .xcworkspace and not not .xcodeproj file and everything would be fine.

ParseFacebookUtil: Apple Mach-O Linker, undefined symbol for architecture x86_64 PFDateFormatter

Error occurs after adding the ParseFacebookUtil
ERROR MESSAGE
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_PFDateFormatter", referenced from:
objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FRAMEWORKS
I am using XCode 6.2
Thanks
edit:
I've added the frameworks social, and accounts. Same error still occurs.
I ended up fixing this issue by deleting the Parse and Bolts framework, and re adding it back into the project.
Edit:
The best solution to this issue is by using cocoapods. It handles the dependencies better than manually dragging in the framework files.

building TestFlightSDK with cocoapods

I seem to be getting the error message while trying to compile TestFlightSDK in my app via cocoapods
Im my Podfile i have the line:
pod 'TestFlightSDK'
And the pod update works fine.
When i try and compile the app i get the message:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_TestFlight", referenced from:
objc-class-ref in OurDealAppDelegate_iPhone.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
my app is only supporting Architecture armv7 (because if i add armv7s or arm64 older libraries fail to compile - so i assume its something to do with this.
Is there any work around for this?
Okay, you need to confirm whether Cocoapods has included libTestFlight.a library in your project. Cocoapods has never added the library for me.
So, please follow the steps below:
Open the Pods-TestFlightSDK target in the Pods.xcodeproj project
Open Build Phases tab and add libTestFlight.a
libTestFlight.a can be found at [$SRCROOT]/Pods/TestFlightsSDK

Resources