SwiftUI Previews not working with Firebase

SwiftUI previews don't seem to work in Xcode 12, beta 5, when using Firebase Analytics. The app builds and runs fine to simulator or device, but fails generating SwiftUI preview for a widget with the following message:

Code Block
ld: in /Users/../.../Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector(FIRAnalyticsConnector_e321ed8e3db06efc9803f6c008e67a34.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/.../.../Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It was working fine in beta 4. Anyone else seen this? Any ideas?

Post not yet marked as solved Up vote post of mikethefish Down vote post of mikethefish
43k views

Accepted Reply

I've seen quite a bit of weird behavior with frameworks, I think due to changes to the simulators to support Apple silicon. My temporary workaround is, in my app/extension targets, to add "arm64" to the Excluded Architectures build setting when building for the simulator (as your preview appears to be trying to do), and setting "Build Active Architecture Only" to No for all schemes. Might be worth a try.
  • Can you please post the navigation path for how to add arm64 to Excluded Architectures and setting "Build Active Architecture Only" to No for all schemes. It will be helpful

  • Thaaaaaaankkk youuuuuuu

  • BuildSettings -> Search -> "Architectures" -> Build Active Architecture Only (list item, exapandable): debug, release

Replies

This looks very much like a Xcode 12 bug. Did anybody already filed a bug in feedback assistant?

Still hitting this issue on XCode 12.5. I've introduced a new SwiftUI class to an existing UIKit app, and had issues with previewer working.

I was planning to learn SwiftUI in a few hours, but I ended up getting stuck on this :)

Hi,

I'm having the same issue. When I exlude arm64, it reads

"Merging extracted architectures:  error: lipo: no input files specified"

I can't find the solution to this answer message anywhere. Any help would be greatly appreciated.

Best, Adam