I'm having a problem with FirebaseAnalytics since running a pod update. I get the error
ld: framework not found FirebaseAnalytics
clang: error: linker command failed with exit code 1 (use -v to see invocation)
and reviewed the answers to this error from other people.
In the case of my app, 'FrameworkSearchPaths' (default and release) looks like this:
$(inherited)
"$PODS_CONFIGURATION_BUILD_DIR/GTMSessionFetcher"
"$PODS_CONFIGURATION_BUILD_DIR/GoogleToolboxForMac"
"${PODS_ROOT}/FirebaseAnalytics/Frameworks/frameworks"
"${PODS_ROOT}/FirebaseAuth/Frameworks/frameworks"
"${PODS_ROOT}/FirebaseCore/Frameworks/frameworks"
"${PODS_ROOT}/FirebaseDatabase/Frameworks"
"${PODS_ROOT}/FirebaseInstanceID/Frameworks/frameworks"
"${PODS_ROOT}/FirebaseStorage/Frameworks/frameworks"
"${PODS_ROOT}/GoogleInterchangeUtilities/Frameworks/frameworks"
"${PODS_ROOT}/GoogleSymbolUtilities/Frameworks/frameworks"
The pod folder looks like this...
My podfile looks like this:
platform :ios, '10.0'
use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Storage'
pod 'Firebase/Database'
pod 'Firebase/Auth'
target 'MyApp' do
end
target 'MyAppTests' do
end
target 'MyAppUITests' do
end
Does anyone have a sequential approach to debugging this error? I didn't have the problem before the pod update.
I've tried a mac restart, reinstalling cocoapods, and re-running both pod update and pod install. I'm working with the latest xCode version.
*********** Update ***************
I've tried some more things:
changing the order of Framework Search Paths, putting the call to FirebaseAnalytics at the end
running shift-command-F to find references to 'FirebaseAnalytics' to see if there are any duplicates or patterns of references that look wrong (didn't see anything)
deleting FirebaseAnalytics and running re-install
the solution proposed in this answer Apple Mach-O-Linker Error CocoaPods by deleting the contents of Other Linker Flags
None of these fix the issue I'm having
More ideas on how to debug the problem are welcome
Go to OtherLinkerFlags in build settings of target & remove 'FirebaseAnalytics" & '-framework' from there.
This works for me.
Related
I'm so frustrated... just cannot fix the error I mentioned in the title. What I tried:
Cleaned Build Folder multiple times
Deleted Derived Data multiple times
Yes, I open the Workspace (not Project)
changing 'No Common Blocks' from Yes to No
pod update, pod install, ...
searched for duplicates
No success so far.... But I think I see the problem:
It looks like there is another DerivedData Folder somehow but I deleted the entire DerivedData Folder multiple times (and also deleted it in the trash. So there cannot be another DerivedData file. Correct me if I'm wrong but it makes no sense to me :(
Or there is a problem with the "nanopb.build" pod thing.. idk :/
Does anyone has a clue how to fix this?
I actually don't even know what the nanopb thing is...
Greetings
Henning :)
EDIT:
Here is my Podfile:
target 'huud' do
use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'GrowingTextView', '0.7.2'
pod "RAGTextField"
pod 'SkyFloatingLabelTextField', '~> 3.0'
pod 'NewPopMenu', '~> 2.0'
pod 'LGButton'
pod 'LocationPicker'
end
None of my 'Firebase' pods are found.
I updated to Xcode 9.
Ran 'pod update'
deitegrated my pods, and re-installed
Deleted 'Derived Data' folder contents
Build from 'Generic Devices'
Added the paths in the Header Search Path in the Build Settings $(inherited)
and
"$(SRCROOT)/Pods"
and
"${PODS_ROOT}/Firebase/Core/Sources"
Cleaned, build, closed the app, re-installed Xcode, restarted the system, and did it all again.
2 Swift Compiler Errors are always there.
'FirebaseAnalytics/FirebaseAnalytics.h' file not found
and
Could not build Objective-C module 'Firebase'
I'm on Sierra 10.12.6
None of these has worked so far to get rid of them. Does anyone know of any other possible solutions?
Here is the pod file info.
Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'MP' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MP
pod 'Firebase'
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
end
------ UPDATE ------
as Hexfire suggested below. I removed pods and manually added the frameworks.
After some fiddling with the pathing for my MP.h file, that first error is gone, however now I am getting these compiler errors now...
:0: error: PCH file '/Users/.../Library/Developer/Xcode/DerivedData/MP-gwnwsbrisiyspxepcxkbrojwtfrs/Build/Intermediates.noindex/PrecompiledHeaders/MP-swift_ZJX6RAPYV1IT-clang_2SW1CJQDTFSBO.pch' not found: module file not found
clang importer creation failed
I built a .pch file 'MP.pch' and I pointed to it in the Build Settings Prefix Header with $(SRCROOT) with no luck. Do I have to put all of my Framework paths in there as well?
All of this seems related to the search paths. Does anyone have any other thoughts here? Perhaps an example of the build settings syntax? For example $(SRCROOT) with quotes or without? $(SRCROOT)/MP.pch or just $(SRCROOT)?
One of the good ways to make this work is by not using CocoaPods. You can grab all necessary Firebase libraries from here and use within your app (if link doesn't work, go here, and scroll down to "Integrate without CocoaPods").
After downloading:
Unzip and see the README file for which Frameworks to include in to your project.
Add the ObjC linker flag in your Other Linker Settings in your target's build settings.
This is a valid option and 100% workable.
P.S. If Firebase is the only pod you are using, you can quickly and safely clean your project from any CocoaPods trails by using pod deintegrate command.
Good luck!
If All Of this do not work Try this for once
run sudo gem install cocoapods
You can check your version by typing pod --version anywhere on your terminal.
Make sure you are using latest Version of it
I'm trying to import JSQMessagesViewController:
import JSQMessagesViewController
And it gives me the error 'no such module'. I've seen many people with this problem on the web but I can't find the solution. Here's my podfile:
# Uncomment this line to define a global platform for your project
platform :ios, ‘9.2’
# Uncomment this line if you're using Swift
use_frameworks!
target ‘IXODES’ do
pod 'JSQMessagesViewController'
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Messaging'
end
I've tried cleaning the build, also pod deintegrate and then pod install and pod update. Nothing works and I can see the library in my project like the rest. Any help?
perhaps you tried to import the file and the file is missing by any chance,
a few things you can do.
you can clean the project from cocoapods and re-install cocoapod(this helped me onetime i got the same problem the file were missing) you can do that by
run this code on the terminal
[sudo] gem install cocoapods-deintegrate
once done
cd your file
and then run thispod deintegrate
then you're all set! and re install it
---- another solution ---
try these
1-Adding all of the .frameworks to the Projects Build Phases -> Link Binary With Libraries
2-Selecting each framework and building it. You can do this by selecting your project name next to the run arrow.
3-Cleaning the project and restarting my computer.
hope it helps
I do a simple swift project using XCode7.3. Everything is ok, UI & Unit test run properly too. However, when I wanna see coverage data, I can not run unit test anymore
ld: framework not found Pods_MapView
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Would you please give me a clue?
P/S: I hostes my project at https://github.com/rickyngk/map-view-demo
Try adding your target to your Podfile:
e.g.:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
use_frameworks!
target 'MapView' do
pod 'GoogleMaps'
end
target 'MapViewTests' do
pod 'GoogleMaps'
end
target 'MapViewUITests' do
pod 'GoogleMaps'
end
I've found my own answer:
Remove Pods & Podfile.lock
Follow this https://stackoverflow.com/a/28116102/1960061
Done
In my project I got cocoapod installed. Here is the structure of Podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
workspace 'TempWorkspace'
inhibit_all_warnings!
target 'proj1' do
pod 'ApplicationInsights', '1.0-beta.4'
pod 'Google/Analytics'
pod 'AFNetworking', '0.9.1'
pod 'MBProgressHUD'
pod 'Reachability'
end
target 'proj1Tests' do
end
target 'proj1UITests' do
end
In this, ApplicationInsights and GoogleAnalytics pod are not creating any issues. But if I add any pod except these 2 in this file, this is giving me following error
"ld: framework not found AFNetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)"
Its not just about AFNetworking only if I write any other pod name also then also it is giving me same error with that pod name.
I tried looking for pod limitations but not it has not given me anything relevant.
If somebody has any idea please tell me.
Thanks in advance!!!
I hope it will help someone with a similar problem with Pods, this answer worked for me on XCode 8:
Delete all your Podfiles from the pods folder (Pods folder should
be empty)
Delete the xcworkspace file
run pod install
Change Build Active Architectures Only to NO for your target
and for all your pods (Click on Pods project and then on each single
Pod)
Add $(inherited) to the Framework Search Path setting of
your target
I run into this problem because I was trying to install the latest Atlas pod which is implicitly installing the latest LayerKit pod and a reference to a framework was missing. For those with a similar problem remember to add use_frameworks! to your podfile.
That same exact problem happened to me. The problem was that I was opening the .xcodeproj file instead of the .xcworkspace file. Once I opened the workspace file all my build errors were gone.
I had the same problems twice. I only use AFNetworking 3.0.4 or 3.1.0.
The method I handled with is to delete all the files:
podFile files, the Podfile.lock file, xcworkspace, the 'Copy Pods Resources' and 'Check Pods Manifest.lock' in Build phases of targets.
After deleting all these, I write the file of podFile and pod install. the problem is solved.