firebase / firebase-ios-sdk

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

SwiftUI Previews wont run #6375

Closed Baza207 closed 4 years ago

Baza207 commented 4 years ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

Since Xcode 12 b5 (and now b6) SwiftUI previews do not run. Running on a device seems to work fine, however the previews always throw an error.

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

This seems to have been a change in Xcode 12 since b5, but I'm not sure if it's a bug (and so will be fixed in a later beta past the current b6 where it's still happening) or if this is something that needs to be fixed in Firebase itself.

It sounds like there's a static framework in GoogleAppMeasurement that for whoever reason Xcode is unable to run in the simulator (and so SwiftUI previews). Interestingly though however the app does run in the simulator directly, just not SwiftUI previews.

Note: I was having this issue also with the ML framework, but then updating it to the latest version got rid of that error and showed this one. It was the same error, but now it's talking about GoogleAppMeasurement.

Relevant Code:

No specific code available.

google-oss-bot commented 4 years ago

I found a few problems with this issue:

Baza207 commented 4 years ago

Possibly related to #6374 and/or #6219.

paulb777 commented 4 years ago

Thanks for the report. It could also be related to #5562.

ryanwilson commented 4 years ago

This looks to be the same as #6374 even though it's using a different package manager, so I'll close this and use that as the issue to track it since it was opened first. I've written a summary and a repro in this comment. Thanks for the report!