firebase-ios-sdk: Can't render SwiftUI canvas with Code Coverage Enabled

Step 0: Are you in the right place?

  • For issues or feature requests related to the code in this repository file a Github issue.
    • If this is a feature request please use the Feature Request template.
  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general (non-iOS) Firebase discussion, use the firebase-talk google group.
  • For backend issues, console issues, and other non-SDK help that does not fall under one of the above categories, reach out to Firebase Support.
  • Once you’ve read this section and determined that your issue is appropriate for this repository, please delete this section.

[REQUIRED] Step 1: Describe your environment

  • Xcode version: _11.6
  • Firebase SDK version: 6.28___
  • Firebase Component: Core___ (Auth, Core, Database, Firestore, Messaging, Storage, etc)
  • Component version: 6.9.1_
  • Installation method: **CocoaPods** | Carthage | Zip file (select one)

[REQUIRED] Step 2: Describe the problem

Can’t render SwiftUI canvas due to FirebaseCore

linker command failed with exit code 1 (use -v to see invocation)

----------------------------------------

LinkDylibError: Failed to build TemplateListView.swift

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

ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator'
Undefined symbols for architecture x86_64:
  "___llvm_profile_runtime", referenced from:
      ___llvm_profile_runtime_user in FirebaseCore(FIRComponentType.o)
      ___llvm_profile_runtime_user in FirebaseCore(FIRConfiguration.o)
      ___llvm_profile_runtime_user in FirebaseCore(FIRDiagnosticsData.o)
      ___llvm_profile_runtime_user in FirebaseCore(FirebaseCore-dummy.o)
      ___llvm_profile_runtime_user in FirebaseCore(FIRAnalyticsConfiguration.o)
      ___llvm_profile_runtime_user in FirebaseCore(FIRBundleUtil.o)
      ___llvm_profile_runtime_user in FirebaseCore(FIRAppAssociationRegistration.o)
      ...
     (maybe you meant: ___llvm_profile_runtime_user)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Steps to reproduce:

Rendering SwiftUI Canvas. The current workaround is to disable code coverage in the build scheme

Relevant Code:

NA

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 18 (9 by maintainers)

Most upvoted comments

@brandtdaniels hope you don’t mind that I changed the title to make it easier to find for folks, and more accurately state the issue. Thanks again for the report.

Any SwiftUI examples seems to reproduce the issue. Here are some SO posts regarding the issue:

https://stackoverflow.com/questions/60440074/problems-with-firebase-and-swiftui-live-previews

This workaround worked my project: https://stackoverflow.com/a/62355502/699002 which references this tweet: https://twitter.com/dannypier/status/1190312160557068293

Hey everyone, I tested this with Xcode 12.5 with my repro steps above and was unable to reproduce - I think this is resolved.

I’m going to close this now, but if you still see the same error using Xcode 12.5 please share steps to reproduce and I’ll re-open the issue!

TODO: Attempt to reproduce with Firebase 7, since dynamic frameworks are now used. Also check with Xcode 12.2 release candidate to see if the Xcode issue is resolved with static frameworks.

Unfortunately it does not Xcode 12 beta 5 does not fix the issue.