Undefined symbol: _OBJC_CLASS_$_FIRAnalytics - ios

I am trying to Call Firebase Analytics in my iOS app ,i am getting error while compiling project .
I have created one framework and from that framework calling firebase analytics but I don’t understand getting below error.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIRAnalytics", 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)
Showing Recent Errors Only
:-1: Undefined symbol: _OBJC_CLASS_$_FIRAnalytics
Below is my app structure
iOS App
MyCustom Framework
Viewcontroller

I had a similar issue when added Firebase using Carthage.
So after running a command
carthage update --platform iOS
you need to copy files from Carthage/Build/iOS/ into your project
Actually it just copied references to Firebase files, but files were still in Carthage/Build/iOS/ folder
After updating of Xcode and therefore Swift - I needed to update my dependencies - and after that, I got such an error
The reason was that after update an additional PromisesObjC.framework was introduced, and it, of course, was not included in the project.
So the complete removal of all Firebase-related frameworks and adding them again - fixed the problem.
P.S. and don't forget to delete Firebase.framework from the Link Binary With Libraries Build Phase in Xcode not to run in another error after update :)
Error: Firebase.framework does not contain bitcode.

Please make sure you import the PromisesObjc.framework after deleting your old Firebase libraries. I tried all the other steps but this one was also required.

In my case this was solved by updating the 'tag' in the following line in ios/Podfile to the most recent tag (based on the github repository):
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '10.1.0'

Related

Linking Xcode iOS project with OCMock using cocoaPod

I installed OCMock using cocoapod for my test project
target 'ProjectTests' do
use_frameworks!
pod 'OCMock'
end
In My test project, Build Phases -> Link Binary with Libraries, I added OCMock.framework (Under Pods). But the actual file doesn't seem to exist there. Am I missing something?
In Build setting, updated Header/Library search path with '/Pods/OCMock/Source/**' (recursive).
My headers are getting referenced, but when I try to the tests I get an error
ld: framework not found OCMock
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anyone help me resolve the issue?

adding ios core framework to podfile

I added a pod to my Podfile and got compiler errors when building:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_CLLocation", referenced from:
objc-class-ref in MoPubAdapter(GADMAdapterMoPub.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I then went to Build Settings > Target > Debug > Other Linker Files and manually added -framework and "CoreLocation".
The compiler did not complain anymore. I assume they were forgotten in as prerequisites for the pod.
Now I don't like the fact that I manually changed this value. I might forget to do this if Cocoapods i.e. overwrites this value again. Is there a way for me do add the CoreLocation framework to the Podfile so that Cocoapods takes care of including it?
Thanks
I am afraid there is no way to do that. Apple does not provide dependency of it's core frameworks on Cocoapods. As a test, you can search for any core library on Cocoapods. You won't find that. As a brief test, here is the result if you try to set pod CoreLocation in Podfile.
Sadly, fixing this manually is the only workaround.
You could add a dependency in your Podfile to a minimal CocoaPod that only adds a dependency to CoreLocation. See here for creating a podspec and here for referencing a podspec from a local path.
A better solution would be to update the offending pod's podspec to add CoreLocation as a framework.

Can't use SDWebImage

Xcode: Version 7.2
OS X: 10.10.5
I'm a newbie into iOS and trying to use SDWebImage in Objective-C by following the official installation guide, but I get this error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_SDWebImageManager", 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)
I downloaded the zip file and unzip-ed it, and added the file to my project.
Also, added a dependency "ImageIO.framework" and Linker Flag "-ObjC".
Screenshot
I've already read these questions:
How to install SDWebImage
Undefined symbols for architecture arm64: “_OBJC_CLASS_$_PayTabCardReaderViewController”, referenced from: objc-class-ref in ViewController.o
Don't download and unzip. This is really the most horrible way to do things. Use CocoaPods, Carthage or at least git submodules. The "unzip way" makes code harder to maintain: you cannot know which version you imported (when you go back to this project in a year), noone knows where is the reference. People will manually change the source files, so later you won't be able to update to the newer version without losing these changes. You also have to setup your project manually, which as it seems, is troublesome for you (and many others, don't worry). Easiest way to fix it? Use CocoaPods.
To do it, open console and type:
$ sudo gem install cocoapods
Close your project in Xcode. Open the path to your .xcodeproj in console. Type:
$ pod init
Open .podfile. Paste there pod 'SDWebImage', '~> 3.7'. In console type:
$ pod install
When it completes, open .xcodeworkspace. Everything should be working fine now.
This might happen due to framework not linked up correctly into the app.
Simply try this steps:
Go to Targets -> Build Phases -> Link Binary with Libraries
Click on + symbol & add it from the project
Clean App & build again
Hope it will help to you.
pod deintegrate + pod install fixed it for me !!!

Quickblox simple chat app

ld: warning: directory not found for option '-F/Users/igorkhomenko/workspace/quickblox-ios-sdk/Framework'
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am new to ios development and quickblox
I get this kind of error..what it is about ? M i missing to add some file .
you seem to have used cocoapods to add this library to your project.
Cocoapods creates, and requires you to use, an xcworkspace file to manage your Xcode project.
This is an error that occurs when you are still using the xcodeproj file instead of the xcworkspace.
Either that or your cocoa pods setup is broken. Try running pod install again or see the website to fix it.
Did you add the quicklblox library through Target Settings -> Build Phases -> Link binary with libraries -> + button?

XCode 6 CocoaPods error : target overrides the `OTHER_LDFLAGS` build setting

I just starting using CocoaPods and I am getting the following errors when I pod install from the terminal (My project is called babyMilestones and I'm trying to use CocoaPods for the ShipLib Framework). :
The babyMilestones [Release] target overrides the FRAMEWORK_SEARCH_PATHS build setting defined in Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the$(inherited)` flag, or
- Remove the build settings from the target.
I'm getting this error for Header Search Paths and Framework Search Paths.
When I try to build my project I get an error on the #import line saying the ShipLib/ShipLib.h file cannot be found. In my project navigator my Pods project is showing properly, and the ShipLib framework is visible.
I never set any of these search paths explicitly, I just let XCode 6 do it's thing. I found this answer : The target ... overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig
I have tried the following :
Deleted all the Framework Search Paths in Build Settings. This did not fix the issue
I then added $(inherited) to the Framework Search Path. I did Clean then Build. This gave new errors of the following type:
ld: warning: directory not found for option '-L/Users/billpaystation/Documents/iOS/babyMilestones/babyMilestones/Pods/build/Debug-iphoneos'
ld: warning: directory not found for option '-F'
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ActionSheetDatePicker", referenced from:
objc-class-ref in EditItemViewController.o
"_OBJC_CLASS_$_SYSincerelyController", referenced from:
objc-class-ref in EditItemViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Action Sheet Picker and Sincerely Controller are the libraries I'm trying to add with Pods.
I noticed that libPods.a is red under Frameworks in my file inspector. So I went to Scheme ->Edit Scheme-> and added Pods to the Build.
I don't really understand the whole target/build settings and I may have made it worse trying so many different things. Any help would be appreciated!
You should add $(inherited) to the Framework Search Path. For the new errors you should go:
TargetSettings->Build Phases->Compile Sources->(+) ActionSheetDatePicker.m, and SYSincerelyController.m classes and then Build and Run.
Here's my problem and solution from yesterday.
target overrides the FRAMEWORK_SEARCH_PATHS build settings
Hope this helps.
In my case it was not an Xcode issue, plus I think that fixing it by hand is a bad idea. I tried to use a different (earlier version) of Cocoapods and it worked fine!
gem install cocoapods -v 0.33.1

Resources