8

I am getting the following error

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

I have tried all the things, like cleaning, reintegrating and updating and installing the PODS, nothing seems to work. Please help. Here is my PODFILE. I have been struggling for the past 2 weeks with this crazy thing

target 'MyProject' do
  use_modular_headers!
  # use_frameworks!

  pod 'GoogleMaps'
  pod 'GooglePlaces'

  pod 'Alamofire'
  pod 'SwiftyJSON' 
  pod 'SwiftKeychainWrapper'

  pod 'FBSDKCoreKit', '4.35'
  pod 'FBSDKShareKit', '4.35'
  pod 'FBSDKLoginKit', '4.35'

  pod 'GoogleSignIn'

  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  pod 'Firebase/Storage'
  pod 'Firebase/Crash'

  pod 'FirebaseStorageCache'

end
A B Vijay Kumar
  • 859
  • 9
  • 10
  • 1
    And that's the only framework that's not being found out of the entire list of frameworks there? You're using `xcworkspace` to build right? – Dani Sep 03 '18 at 16:13
  • yes thats right..thats the only one that is giving this error. while I can clearly see it in the Xcode Pods project – A B Vijay Kumar Sep 03 '18 at 16:18
  • Okay, try to go through (or simply click on) each `FirebaseCore` file in Pods. Then try to build again (for some reason, this works sometimes). If it doesn't work, clean then build again and eventually restart Xcode – Dani Sep 03 '18 at 16:23
  • I tried this..no use. It still shows the same error :-( – A B Vijay Kumar Sep 03 '18 at 23:52
  • @Dani Yes, and yes I am using the xcworkspace. – A B Vijay Kumar Sep 11 '18 at 04:13
  • I really wish I could help you more, but those are usually all the things I do to make Xcode find a framework and I never experienced this kind of a behavior – Dani Sep 11 '18 at 07:17
  • I suspect its something to do with proper usage of #use_frameworks! use_modular_headers! – A B Vijay Kumar Sep 11 '18 at 13:13
  • Try removing the `#` in front of `use_frameworks!` – Dani Sep 11 '18 at 13:16
  • 1
    I tried that I get the following error, when I do pod install "target has transitive dependencies that include static frameworks: (FirebaseAuth, FirebaseCore, FirebaseDatabase, and FirebaseStorage)" – A B Vijay Kumar Sep 12 '18 at 14:23
  • I'm out of ideas already. I really don't know what's causing this. PS: my project doesn't have a `#` in front of `user_frameworks!` and it's working perfectly fine. I don't know if you haven't messed up something in your project. – Dani Sep 12 '18 at 14:35
  • thanks, I am trying various things..just got Xcode GM. trying with that..previously Iw as using Beta versions.I am cleaning up everything and installing from the scratch – A B Vijay Kumar Sep 13 '18 at 02:21
  • If it's a huge project and you cant start from scratch, I'd go as far to reinstall cocoapods and all the pods in the project. – Dani Sep 13 '18 at 07:06
  • I had a the same problem appearing when I switched from pod 'Google/SignIn' to pod 'GoogleSignIn', and couldnt find a fix. So one thing you could try is to point to pod 'Google/SignIn', although it is an older version. You can check this url for more details on the difference https://github.com/firebase/firebase-ios-sdk/issues/2100 – Tao-Nhan Nguyen Aug 12 '19 at 01:26

2 Answers2

1

If you look at the workspace in Xcode but cannot drill into the project from there then your issue is that your workspace is not opening properly. There should be an expand arrow next to the project name in the workspace explorer. In my case it was because the Project file was being opened by Xcode first before it was opening the Workspace. Since the project was already in use it could not be used again by the workspace. There is no appropriate error message to alert you to this situation.

To fix:

  1. Open xcode
  2. Close all projects and workspaces
  3. Close Xcode (Now the next time you open Xcode it will not open your old project first by default)
  4. Open the Workspace file

Now you should be able to drill into your Xcode project from within your workspace.

I wrestled with this problem as a noob to CocoaPods and Analytics and working with Workspaces. I had added CocoaPods and Firebase to an existing application that had not used CocoaPods before. Once you add CocoaPods you should only ever open the Xcode project through the Workspace.

FWIW: I found this link useful to understand what was going on: Xcode Project vs. Xcode Workspace - Differences

KeithTheBiped
  • 832
  • 10
  • 21
-1

Try it to do by Changing the deployment target to iOS 11. It worked for me.

Piyush Naredi
  • 159
  • 1
  • 10