Live Preview fails after adding 3rdParty libraries

With the latest Xcode 16 RC version, the Live Preview on iPhone device problem has been fixed.

However, it still fails on the iPhone 16 pro preview emulator even for the simplest hello world view.

Apparently in Xcode 16, introducing any 3rdParty package impacts the preview build, even if the package is not referenced in the view. I feel this is an incorrect behaviour.

Following are the steps to reproduce the problem:

  1. Create a new iOS project in the latest Xcode 16 beta
  2. Select ContentView in the project and verify the live preview is working and fast
  3. Go the project’s Package Dependencies tab, add gRPC-Swift (https://github.com/grpc/grpc-swift.git) as a 3rdParty library of this project.
  4. Go the main project target, select General tab.
  5. Under Frameworks, Libraries, and Embedded Content section, add “GRPC”
  6. Go back to ContentView and verify its live preview rendering now takes very long time and eventually failed.
  7. Select Live Preview Diagnostic, verify error message: Failed to launch app ”PreviewBug.app” in reasonable time…

I have also created a feedback to Apple: FB15110765

Hi,

Sorry to hear you are having problems getting previews working together with third party libraries such as "GRPC".

Thanks for already filing a feedback report. I'll make sure the right team is looking at your bug report!

Hi!

Same issue here on XCode 16RC. Did you find some workaround?

I have the same issue,anyone knows how to solve this??

https://private-user-images.githubusercontent.com/96557710/378172592-27bfd560-c8d9-4320-b582-8ab0b04746a1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjk0MjE2NjUsIm5iZiI6MTcyOTQyMTM2NSwicGF0aCI6Ii85NjU1NzcxMC8zNzgxNzI1OTItMjdiZmQ1NjAtYzhkOS00MzIwLWI1ODItOGFiMGIwNDc0NmExLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDIwVDEwNDkyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM2N2FkODk5MGU5YjE2OTJlMDk1MTQ3OTlhZThmMjJjMjgxNTk0MDI3NWQxYTMwZDZiM2NlYjE5Y2MyNjEwYzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3tF52sw41qHtcO9W5ikW4uk7bUaIrH0ZiaxUJbkvt4w

and used a lot of cpu

Live Preview fails after adding 3rdParty libraries
 
 
Q