Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ld: framework not found after pod install

I added Firebase libraries to my project, and then I got this error. When I compile it, Xcode can't find some directories. However, they are in the Pods directory.

Here is the error log:

ld: warning: directory not found for option '-F/Users/Erumaru/Library/Developer/Xcode/DerivedData/ToDoTogether-gkzytezmbbgkikgoxjpptxgrixil/Build/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: warning: directory not found for option '-F/Users/Erumaru/Library/Developer/Xcode/DerivedData/ToDoTogether-gkzytezmbbgkikgoxjpptxgrixil/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac'
ld: framework not found GTMSessionFetcher
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Here is my Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'ToDoTogether' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  platform :ios, '10.0'
    pod 'Firebase'
    pod 'Firebase/AdMob'  
    pod 'Firebase/Auth'
    pod 'Firebase/Crash'
    pod 'Firebase/Database'
    pod 'Firebase/Analytics'
    pod 'Firebase/Messaging'
    pod 'Firebase/RemoteConfig'
    pod 'Firebase/Storage'

  # Pods for ToDoTogether

end
like image 688
えるまる Avatar asked Oct 29 '16 20:10

えるまる


People also ask

How do you add a framework in CocoaPods?

Open a command line terminal at the location of your Xcode project. Run the pod init command to create a Podfile file. Open the new Podfile file also at the Xcode project root. Comment out or remove the entire existing content.

How do I import a framework into Xcode?

To include a framework in your Xcode project, choose Project > Add to Project and select the framework directory. Alternatively, you can control-click your project group and choose Add Files > Existing Frameworks from the contextual menu.


2 Answers

Make sure you are opening the workspace file and not the project file. I was receiving the same error and realized I was using the project not the workspace.

like image 78
genghiskhan Avatar answered Oct 02 '22 09:10

genghiskhan


I was facing same issue and I tried multiple things but still it was not working. I tried below.

  1. Using XCworkspace file
  2. Cleaned the project, restarted XCode, Mac
  3. Turned bitcode to No
  4. Deleted the search path for Framework, Library

Finally the thing that worked is, deleting pod file and re-creating pod file. It worked as magic!

P.S.: This is very generic error and so same solution may not work for all.

like image 20
Pandurang Yachwad Avatar answered Oct 02 '22 10:10

Pandurang Yachwad