fermoya / cocoapods-catalyst-support

Ruby extensions to help you configure your pods project so that pods not compiled for Catalyst can still be used for iOS devices
MIT License
111 stars 18 forks source link

FirebaseUI #20

Open rojo69 opened 3 years ago

rojo69 commented 3 years ago

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
fermoya commented 3 years ago

@rojo69 do you mean when using in iOS?

fermoya commented 3 years ago

@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: https://github.com/FirebaseExtended/flutterfire/issues/3980

AFIK that's not an issue of this plugin

rojo69 commented 3 years ago

It doesn’t compile for Mac. Error during @import of FirebaseUI. We exclude Google’s auth implementation for Catalyst, but keep others such as Facebook, phone, mail and Apple.

BR! /Roger

30 mars 2021 kl. 20:45 skrev Fernando @.***>:

 Closed #20.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

fermoya commented 3 years ago

@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:

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?

rojo69 commented 3 years ago

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'
fermoya commented 3 years ago

@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

rojo69 commented 3 years ago

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.

fermoya commented 3 years ago

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

rojo69 commented 3 years ago

The app builds fine in Catalyst if I remove 'FirebaseUI/Google'. I haven’t tested all aspects of the other libraries, but I have authenticated using some of them.

1 apr. 2021 kl. 18:00 skrev Fernando @.***>:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

fermoya commented 3 years ago

@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

rojo69 commented 3 years ago

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)