firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.56k stars 1.45k forks source link

Undefined symbols for architecture x86_64 #6695

Closed SValchyshyn closed 3 years ago

SValchyshyn commented 3 years ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur? The project compiles OK, no problem with that. I have added the FirebaseAnalytics to the project following your Carthage steps. Here is my Cartfile: binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"

And here is my Frameworks section: 2020-10-08 at 14 36

One of the error I'm receiving that's blocking the build:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_GULSwizzler", referenced from:
      objc-class-ref in GoogleAppMeasurement(UIViewController+APMScreenClassName_d414992ede38c698bc9a23de180c8cb5.o)

Here is the full list: 2020-10-08 at 14 38

So, I have been trying to fix it by adding libc++.tbd, libsqlite3.tbd, and libz.tbd. Also, I have run through the Firebase frameworks adding everything I can find in modulemap to my Frameworks section and it didn't help.

Firebase frameworks have also been copied from the Carthage folder to the root proj folder. Nothing of above helps. Do you have any ideas?

If you have a downloadable sample project that reproduces the bug you're reporting, you will likely receive a faster response on your issue.

Relevant Code:

google-oss-bot commented 3 years ago

I found a few problems with this issue:

paulb777 commented 3 years ago

@SValchyshyn Sorry to hear about the issue.

Make sure that GoogleUtilities.framework shows up in the Link Binary With Libraries build phase.

SValchyshyn commented 3 years ago

@paulb777 Hi, thanks for your reply. Yes, it is included in the phase. 2020-10-08 at 20 04

morganchen12 commented 3 years ago

Can you share your project?

SValchyshyn commented 3 years ago

Unfortunately not 🙁 I can provide you with any other screens like build settings or anything

morganchen12 commented 3 years ago

If you're able to reproduce these linker errors in a blank project we'll be better equipped to provide support. Outside of that, the symbols missing in your target are present in the GoogleUtilities framework, so the only thing that comes to mind is maybe you've linked GoogleUtilities into the wrong build target.

SValchyshyn commented 3 years ago

@morganchen12 I have managed to reproduce not exactly these but similar errors. Please, check it out: https://github.com/SValchyshyn/FirebaseBugTest

I have not included GoogleService-Info.plist intentionally as it is not required for the build phase.

paulb777 commented 3 years ago

The test project looks like a different issue. It's linker failure is resolved by adding StoreKit to the Link With Libraries Build Phase:

Screen Shot 2020-10-09 at 7 07 18 AM

google-oss-bot commented 3 years ago

Hey @SValchyshyn. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

SValchyshyn commented 3 years ago

I have found the issue on my project. We have a modular architecture and one of our modules is using MLKit that was manually built as .xcframework. It appeared that those errors are present when building the app with both Google services. I will reply here if no more issues will be found.

SValchyshyn commented 3 years ago

Works well now. Modules were fetching dependencies with different versions which results in compile confusion.