Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwiftUI canvas preview compile error: Undefined symbols for architecture x86_64

Tags:

xcode

swiftui

I have a project where I am using Firebase's Firestore and Auth. When I create a SwiftUI view, the preview canvas doesn't work. I get the following error.

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

failedToBuildDylib: ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator'
Undefined symbols for architecture x86_64:
  "___asan_alloca_poison", referenced from:
      +[GDTFLLUploader gzippedData:] in GoogleDataTransportCCTSupport(GDTFLLUploader.o)
  "___asan_allocas_unpoison", referenced from:
      +[GDTFLLUploader gzippedData:] in GoogleDataTransportCCTSupport(GDTFLLUploader.o)
  "___asan_handle_no_return", referenced from:
      -[FIRAuthCredential init] in FirebaseAuth(FIRAuthCredential.o)
      -[FIRAuthCredential prepareVerifyAssertionRequest:] in FirebaseAuth(FIRAuthCredential.o)
      -[FIREmailAuthProvider init] in FirebaseAuth(FIREmailAuthProvider.o)
      -[FIRCollectionReference initWithQuery:] in FirebaseFirestore(FIRCollectionReference.o)

This happens even with the most basic "Hello World" View, where I don't import anything related to Firebase.

Is there anything I can do about this, or can I simply not use the preview canvas in this entire project?

like image 836
Kevin Renskers Avatar asked Jan 12 '20 15:01

Kevin Renskers


3 Answers

You can find a solution for it here by unchecking Code Coverage option

https://twitter.com/dannypier/status/1190312160557068293 enter image description here

like image 97
jawad Avatar answered Oct 13 '22 19:10

jawad


This worked for me: Disable Code Coverage for the scheme.

Answer found at: CocoaPods Issue

like image 21
Nikola Ristic Avatar answered Oct 13 '22 20:10

Nikola Ristic


I managed to fix it by unchecking the "Address sanitizer" option from the scheme's diagnostics options.

like image 25
Kevin Renskers Avatar answered Oct 13 '22 19:10

Kevin Renskers