FirebaseUI-iOS icon indicating copy to clipboard operation
FirebaseUI-iOS copied to clipboard

'framework not found FBSDKLoginKit for architecture x86_64' after updating to FirebaseUI 0.7.0

Open yorgosg opened this issue 10 years ago • 30 comments

I updated to FirebaseUI 0.7.0 and I now have this error when building the project I am working on:

"framework not found FBSDKLoginKit for architecture x86_64"

Before updating I used to have the following pod versions:

FBSDKCoreKit 4.15.1 FBSDKLoginKit 4.15.1 FBSDKShareKit 4.15.1

and after performing pod install to update to FirebaseUI 0.7.0, the FBSDLoginKit was updated to 4.17.0 and then the errors started appearing. I updated all three pods to 4.17.0 but the error persists. Also tried to use 4.15.1 for all pods but again the error persists.

Has anyone seen something similar?

I am using Xcode 8.1 and Cocoapods 1.1.0 (was using 1.0.0 and updated to 1.1.0 to see if it helped but it didn't).

yorgosg avatar Nov 04 '16 20:11 yorgosg

If you go into your Pods/ folder, can you find the framework there? I suspect CocoaPods is building it and dropping it in your Pods folder and then just not making it visible to xcodebuild.

morganchen12 avatar Nov 04 '16 21:11 morganchen12

The FBSDLoginKit is in the Pods/ folder alright. So, something else is wrong I guess. Any help is appreciated!

yorgosg avatar Nov 04 '16 22:11 yorgosg

You can work around this by dropping the directory in your FRAMEWORK_SEARCH_PATHS in your xcodeproj file.

FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FBSDKLoginKit"

This is something we should probably put in our podspec

morganchen12 avatar Nov 04 '16 22:11 morganchen12

@morganchen12 I tried this but it doesn't seem to work. I see you committed this change, so it might be fixed when I update to the next version. Any other ideas how to fix this in the meanwhile?

yorgosg avatar Nov 04 '16 23:11 yorgosg

I wasn't able to repro this in our sample apps or test targets, do you have a project you can share?

morganchen12 avatar Nov 04 '16 23:11 morganchen12

I'll see if it is reproduced in a project I can share. Cheers.

yorgosg avatar Nov 04 '16 23:11 yorgosg

@morganchen12 I haven't resolved this issue yet. Unfortunately, I cannot share a project with this happening. I tried this at another computer and same exact thing happens. First, when I update the pod from 0.5.5 to 1.0.0 the same error happens for GoogleAuthUtilities, but because the pod is missing. I add it to the podfile and then next thing the same error takes place for FBSDKLoginKit.

The commit you did yesterday is not in 1.0.0, right?

yorgosg avatar Nov 05 '16 17:11 yorgosg

Yeah, I didn't merge that commit. You're free to cherry-pick it to see if it fixes your issue.

morganchen12 avatar Nov 06 '16 03:11 morganchen12

Hi again @morganchen12 , this actually did help. I used a local podspec with your commit and that error went away! Cheers for that!

However, after now updating to FirebaseUI 1.0.0, I see that the classes are not renamed to the FUI prefix. I still have the FIR... files under the FirebaseAuth framework. Any ideas? I know have the following pod versions:

Using Firebase (3.9.0) Using FirebaseAnalytics (3.5.1) Using FirebaseAuth (3.0.6) Using FirebaseCore (3.4.4) Using FirebaseDatabase (3.1.0) Using FirebaseInstanceID (1.0.8) Using FirebaseMessaging (1.1.1) Using FirebaseStorage (1.0.4) Using FirebaseUI (1.0.0)

yorgosg avatar Nov 07 '16 16:11 yorgosg

FirebaseAuth is a Firebase framework, so it should be using the FIR prefix. Only the FirebaseAuthUI classes should be using FUI.

You can use the same build file setting in that commit without maintaining a separate podspec by just adding the line of xcconfig into your xcodeproj file.

morganchen12 avatar Nov 07 '16 17:11 morganchen12

@morganchen12 the reason I am saying I don't have the classes is because I am trying to use FUIAuthPickerViewController by importing the following:

@import FirebaseAuth;
@import FirebaseAuthUI;

but Xcode says FirebaseAuthUI module is not found.

About adding this line into xcodeproj, I have tried adding it to framework search path through Xcode but it didn't work. I am not sure exactly where to add it in the xcodeproj file.

yorgosg avatar Nov 07 '16 18:11 yorgosg

Hm, if Xcode can't find the framework module after cleaning/deleting DerivedData that probably means your framework search paths are messed up again. Can you make a sample project that reproduces this? If not, try adding ${PODS_ROOT}/FirebaseUI/FirebaseUIFrameworks/** to your framework search paths.

morganchen12 avatar Nov 07 '16 22:11 morganchen12

Hi again @morganchen12 , as it turns out, for some reason I was not getting version 1.0.0 of the pod, even though it was supposed to be installing version 1.0.0. I noticed that I didn't have the latest frameworks under the FirebaseUIFrameworks folder. I ended up manually adding them in that folder, and now I have the "framework not found FBSDKLoginKit for architecture" error again. So, still struggling. Thanks for all your help.

yorgosg avatar Nov 08 '16 12:11 yorgosg

Can you share your podfile and any xcconfigs you have?

morganchen12 avatar Nov 08 '16 18:11 morganchen12

Ok so I'm having the same issue @yorgosg did to begin with: Linker can't find the FBSDKLoginKit when it's definitely there. I've tried adding the SDK to my framework search paths manually but I'm still having issues. I know that I have the kit installed correctly via pods. I've cleared out all my derived data and no dice still. I'm using FirebaseUI 1.0

I can't really share my project but I will mention that it's a pre-existing project that I'm trying to plug FirebaseUI into... to no success. I looked at the mentioned commit and didn't see anything in it besides just a change to that one file so I'm not sure how yorgosg managed to get his build running.

Any ideas?

matthewbahr avatar Nov 08 '16 22:11 matthewbahr

Can you share your podfile?

morganchen12 avatar Nov 08 '16 23:11 morganchen12

target 'BeaconWatch' do

  pod 'Reachability'
  pod 'CocoaAsyncSocket'
  pod 'RestKit', '~> 0.20.0'

  # Backend pods
  pod 'Firebase/Core'
  pod 'Firebase/Database'
  pod 'FirebaseUI', '~> 1.0'
  # Firebase dependencies
  pod 'FBSDKCoreKit'
  pod 'FBSDKShareKit'
  pod 'FBSDKLoginKit'


  # Testing and Search are optional components
  pod 'RestKit/Testing', '~> 0.20.0'
  pod 'RestKit/Search',  '~> 0.20.0'

end

matthewbahr avatar Nov 08 '16 23:11 matthewbahr

I was able to repro this issue with your Podfile, thanks 👍

The issue goes away if you add use_frameworks! to your Podfile. If you for whatever reason are unable to use frameworks, it looks like CocoaPods is adding -framework arguments to the OTHER_LDFLAGS build setting. You can work around it at the cost of CocoaPods producing ugly warnings by avoiding inheriting settings under Other Linker Flags.

Possibly related to https://github.com/CocoaPods/CocoaPods/issues/6065, though this could also be misconfiguration on our part.

morganchen12 avatar Nov 08 '16 23:11 morganchen12

Fantastic. I had seen adding that flag was necessary for swift, good to know you need it for Obj-C as well.

matthewbahr avatar Nov 08 '16 23:11 matthewbahr

This is great, it finally worked!! After adding use_frameworks! to my pod file I also had to remove all the pod libraries from the other linker flags in build settings.

@matthewbahr for your previous question, I managed to get it to work for a little while by using a local podspec for the Firebase pod, but now it is not needed.

@morganchen12 I appreciate all the help! Thanks a million! I am closing the issue.

yorgosg avatar Nov 09 '16 09:11 yorgosg