37

I added Google Analytics by CocoaPod into my project, but my app crashed and gave the following error.

ld: framework not found FirebaseAnalytics
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What should i do to solve this issue ? I followed this tutorial from google to integrate the Google Analytics into my project.

Nuibb
  • 1,800
  • 2
  • 22
  • 36
  • This thread could help: https://stackoverflow.com/questions/37485141/firebase-cocoa-pods-installation-not-working/54234327#54234327 – Alex Lopez Jan 17 '19 at 10:59

14 Answers14

76

You are probably using cocoapods to add Firebase. Make sure that in the build settings for your target the 'Framework Search Paths' both for Debug and Release start with $(inherited).

The build settings for your pod dependencies are defined in a xcconfig file, if you don't have $(inherited) in your target's build settings, the settings from this file will be ignored.

Marcel
  • 6,393
  • 1
  • 30
  • 44
22

I had the same error, my Framework Search Paths in Build Settings were already set to $(inherited) for both Debug and Release.

I managed to solve this with the solution here: https://stackoverflow.com/a/38246169/1092815

In other words, Podfile.lock had some bad versions in it, running this solved the my issue:

pod update
pod install
Community
  • 1
  • 1
GabLeRoux
  • 16,715
  • 16
  • 63
  • 81
  • 1
    I was getting the `Error: Debug map not found for ....Build/Products/Debug-iphonesimulator/****.app/.... file not found in directory` message for the longest time. This finally solved my crisis. Thank you @GabLeRoux – Friendly-Robot Mar 24 '18 at 21:51
  • If you still get same error after pod update and pod install. Clean your build folder and then Build the Project again. (Product > Clean Build Folder ) – Rohit Singh Nov 17 '21 at 18:26
7

I also had this issue and resolved with this:

pod deintegrate && pod install

CocoaPods doc on pod deintegrate: https://guides.cocoapods.org/terminal/commands.html#pod_deintegrate

Edicarlos Lopes
  • 971
  • 10
  • 5
1

You need to remove linked framework from project properties.

Smith John
  • 11
  • 2
1

I had this issue and resolved it: - Go to Info.plist -> Build Settings -> Framework Search Paths - Verify/fix the paths. In my case, it was the additional Fbsdk search path that was causing issue (see attached picture) error

I changed it to: fix

Long Le
  • 301
  • 2
  • 2
0

Maybe You have already added other Framework Search Path to Build setting,

Step 1: Remove all frame work search path in Build setting
Step 2: run Pod install 
Step 3: Add others Framework search path (That's removed in step 1).

Now Run Project!

Linh Nguyen
  • 2,006
  • 1
  • 20
  • 16
0

Make sure that pod 'Firebase/Core' is listed in your podfile; if Firebase/Core is not listed, FirebaseAnalytics will not be installed.

ch1maera
  • 1,369
  • 5
  • 20
  • 42
0

Add FirebaseAnalytics.framework from Pods (project) > Pods > FirebaseAnalytics > Frameworks into your project target's Build Phases > Link Binary with Libraries.

Clean project, exit Xcode, wipe Derived Data, open Xcode and try again )

0

Make sure your Xcode project is not being loaded by Xcode before the workspace. As a noob to CocoaPods and workspaces I did not realize that my workspace was not being loaded properly because it was still loaded in Xcode. If you can't drill into your project from the Workspace explorer window this is your problem.

To fix:

  1. Open Xcode.
  2. Close all projects and workspaces in Xcode.
  3. Close Xcode.
  4. Open the workspace file

Now you should be able to build the workspace properly.

KeithTheBiped
  • 832
  • 10
  • 21
0

Try to change platform :ios, '.....' on the Podfile.

I updated to 11.4 and the problem occurred. When I change back to platform :ios, '10.3' then the problem fixed.

Don't forget to run pod install after editing the Podfile.

ali6p
  • 1,683
  • 13
  • 17
0

For me, the only solution was to upgrade my Cocoapods gem.

In my Gemfile, the version was 1.7.3, so switching to a later version, 1.10.2 at the time, fixed the problem.

After upgrading the Gem, just run pod install again.

You can check your Cocoapods version with pod --version command line.

rafaelfpereira
  • 511
  • 3
  • 5
0

Solved by adding arm64 to Excluded Architectures (EXCLUDED_ARCHS) in the Project settings.

landonandrey
  • 1,271
  • 1
  • 16
  • 26
0

You need to install FirebaseAnalytics yarn add @firebase/analytics then do pod install. It worked for me

Chandni
  • 692
  • 1
  • 10
  • 25
0

Even when the search paths are correct, it seems that some libraries have the extension .xcframework instead of the expected .framework and are therefore not found. I have no clue why this happens or who is to blame, but I was able to fix it by manually adding those frameworks explicitly. enter image description here

iforce2d
  • 8,194
  • 3
  • 29
  • 40