firebase / quickstart-unity

Firebase Quickstart Samples for Unity
https://firebase.google.com/games
Apache License 2.0
826 stars 428 forks source link

[Bug] Firebase + Facebook SDK not working together #961

Closed uchar closed 3 years ago

uchar commented 3 years ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the issue here:

I tried adding both firebase and facebook to my project, it builds fine but as soon as I use it, the application crash. It's probably related to this issue. There is a suggestion here but after changing Podfile to this :

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'

target 'UnityFramework' do
  pod 'FBSDKCoreKit', '~> 9.0'
  pod 'FBSDKGamingServicesKit', '~> 9.0'
  pod 'FBSDKLoginKit', '~> 9.0'
  pod 'FBSDKShareKit', '~> 9.0'
  pod 'Firebase/Analytics', '7.0.0'
  pod 'Firebase/Core', '7.0.0'
  pod 'Firebase/RemoteConfig', '7.0.0'
end

use_frameworks! :linkage => :static

I get this error during the build:

 Linking UnityFramework
⚠️  ld: arm64 function not 4-byte aligned: _unwind_tester from /Users/runner/work/Need-For-Fruits/Need-For-Fruits/build/iOS/iOS/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
⚠️  ld: Could not find or use auto-linked library 'swiftCompatibility50'
⚠️  ld: Could not find or use auto-linked library 'swiftObjectiveC'
⚠️  ld: Could not find or use auto-linked library 'swiftCompatibility51'
⚠️  ld: Could not find or use auto-linked library 'swiftCoreFoundation'
⚠️  ld: Could not find or use auto-linked library 'swiftDarwin'
⚠️  ld: Could not find or use auto-linked library 'swiftWebKit'
⚠️  ld: Could not find or use auto-linked library 'swiftUIKit'
⚠️  ld: Could not find or use auto-linked library 'swiftMetal'
⚠️  ld: Could not find or use auto-linked library 'swiftCoreGraphics'
⚠️  ld: Could not find or use auto-linked library 'swiftDispatch'
⚠️  ld: Could not find or use auto-linked library 'swiftCoreImage'
⚠️  ld: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements'
⚠️  ld: Could not find or use auto-linked library 'swiftAccelerate'
⚠️  ld: Could not find or use auto-linked library 'swiftAVFoundation'
⚠️  ld: Could not find or use auto-linked library 'swiftCore'
⚠️  ld: Could not find or use auto-linked library 'swiftFoundation'
⚠️  ld: Could not find or use auto-linked library 'swiftCoreMedia'
⚠️  ld: Could not find or use auto-linked library 'swiftsimd'
⚠️  ld: Could not find or use auto-linked library 'swiftCoreAudio'
⚠️  ld: Could not find or use auto-linked library 'swiftQuartzCore'
⚠️  ld: Could not find or use auto-linked library 'swiftos'
⚠️  ld: Could not find or use auto-linked library 'swiftPhotos'
⚠️  ld: Could not find or use auto-linked library 'swiftCoreMIDI'
⚠️  ld: Could not find or use auto-linked library 'swiftUniformTypeIdentifiers'
⚠️  ld: Could not find or use auto-linked library 'swiftCoreLocation'

❌  ld: symbol(s) not found for architecture arm64

❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

** ARCHIVE FAILED **

[09:36:49]: ▸       __swift_FORCE_LOAD_$_swiftMetal_$_FBSDKLoginKit in FBSDKLoginKit(LoginManager.o)
[09:36:49]: ▸       __swift_FORCE_LOAD_$_swiftMetal_$_FBSDKShareKit in FBSDKShareKit(Enums+Extensions.o)
[09:36:49]: ▸      (maybe you meant: __swift_FORCE_LOAD_$_swiftMetal_$_FBSDKLoginKit, __swift_FORCE_LOAD_$_swiftMetal_$_FBSDKShareKit , __swift_FORCE_LOAD_$_swiftMetal_$_FBSDKCoreKit )
[09:36:49]: ▸ ld: symbol(s) not found for architecture arm64
[09:36:49]: ▸ clang: error: linker command failed with exit code 1 (use -v to see invocation)
[09:36:49]: 
[09:36:49]: ⬆️  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error

Steps to reproduce:

Just add Facebook and firebase to the same project, firebase stop working

cynthiajoan commented 3 years ago

Hi @uchar, can you try this work around to see that can fix your issue?

uchar commented 3 years ago

@cynthiajoan Yeah that solution works, But I opened this issue to let the Firebase team, knows the second approach cause build errors, and implementing it in the next release would break some build environments ( My build was a part of CI Pipeline using fastlane)