fermoya/cocoapods-catalyst-support

FirebaseUI

Opened this issue · 11 comments

Greetings!

I'm having trouble using this with FirebaseUI. Trying to exclude Google's login option when building for Catalyst, but that seems to remove parts from the other authentication variants too, causing compilation (include) errors later.

	pod 'FirebaseUI/Auth'
	pod 'FirebaseUI/Phone'
	pod 'FirebaseUI/Facebook'
	pod 'FirebaseUI/Google'
	pod 'FirebaseUI/Email'
	pod 'FirebaseUI/OAuth'

	catalyst_configuration do
		# verbose!

		ios 'Firebase/Analytics'
		ios 'FirebaseUI/Google'
	end

@rojo69 do you mean when using in iOS?

@rojo69 the following Podfile:

use_frameworks!

target 'Sample' do
  pod 'FirebaseUI/Google'
end

doesn't compile:
Screen Shot 2021-03-30 at 19 40 50
Not sure if that's your issue, but a quick Google search takes me to this issue in with that pod:
firebase/flutterfire#3980

AFIK that's not an issue of this plugin

@rojo69 I've created the following branch:
https://github.com/fermoya/cocoapods-catalyst-support/tree/fix/issue-20

in which I've included the same dependencies as you. After running pod install, It builds successfully:
Screen Shot 2021-03-30 at 21 21 48

Next steps:

  • Download the Sample project and check that it's also compiling for you
  • Run pod install and check that it still compiles

If any of the steps fails, please add information about the environment (there's a template for a reason).

If it compiles, is there anything from the Docs that wasn't clear that you missed to do?

After doing a pod update the sample project compiled for both iOS and Catalyst.

However after adding import FirebaseUI to the AppDelegate Mac compilation failed with a similar issue as in my project.

/Users/roger/Library/Developer/Xcode/DerivedData/Sample-aqhgnvhixqisefgsaisxnjlhbsjq/Build/Products/Debug-maccatalyst/FirebaseUI/FirebaseUI.framework/Modules/module.modulemap:2:19: Umbrella header 'FirebaseUI-umbrella.h' not found

/Users/roger/cocoapods-catalyst-support/Sample/Sample/AppDelegate.swift:9:8: Could not build Objective-C module 'FirebaseUI'

@rojo69 how do you import FirebaseUI? You should do it like:

#if !targetEnvironment(macCatalyst) 
    import FirebaseUI
#endif

As specified in the What does this library DO? section

I do it without the preprocessor conditional statements, just import FirebaseUI.
I still need to use FirebaseUI in Mac, but not Google's authentication since it's not compatible with Catalyst.
My guess is that crucial parts (shared libraries?) of FirebaseUI is filtered away when FirebaseUI/Google is excluded.

@rojo69 I think any of those frameworks work with macCatalyst? have you tried?

@rojo69 do you wanna try to install this gem attached and let me know if it works?
cocoapods-catalyst-support-0.1.3.gem.zip

You just need to unzip it and run sudo gem install cocoapods-catalyst-support-0.1.3.gem

Sorry about late answer. This time I got a different error:

ld: warning: directory not found for option '-F/Users/roger/Library/Developer/Xcode/DerivedData/Just_Right-cnrxkqgpgwwcotdukrrjkfabyzsb/Build/Products/Debug-maccatalyst/AppAuth'
ld: warning: directory not found for option '-F/Users/roger/Library/Developer/Xcode/DerivedData/Just_Right-cnrxkqgpgwwcotdukrrjkfabyzsb/Build/Products/Debug-maccatalyst/GTMAppAuth'
ld: warning: directory not found for option '-F/Users/roger/Library/Developer/Xcode/DerivedData/Just_Right-cnrxkqgpgwwcotdukrrjkfabyzsb/Build/Products/Debug-maccatalyst/XCFrameworkIntermediates/FirebaseAnalytics'
ld: warning: directory not found for option '-F/Users/roger/Library/Developer/Xcode/DerivedData/Just_Right-cnrxkqgpgwwcotdukrrjkfabyzsb/Build/Products/Debug-maccatalyst/XCFrameworkIntermediates/GoogleAppMeasurement'
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_GIDSignIn", referenced from:
      objc-class-ref in FirebaseUI(FUIGoogleAuth.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)