SRGSSR / playsrg-apple

The Play SRG applications for iOS and tvOS
https://srgssr.github.io/playsrg-apple/
MIT License
44 stars 3 forks source link

SwiftUI previews build failed #234

Closed pyby closed 2 years ago

pyby commented 2 years ago

Issue type

Incorrect behavior

Crash

Description of the problem

With Xcode 14, the build for swiftUI previews failed with message:

HumanReadableSwiftError

SettingsError: noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable:ObjectIdentifier(0x000060004a5a4090):'GoogleCastSDK-ios-no-bluetooth'>)

Other developers have the same issue with Xcode 14 beta 2 and 3. An Apple engineer is aware of. https://developer.apple.com/forums/thread/707569

Discovered during Xcode beta version: https://github.com/SRGSSR/playsrg-apple/issues/212#issuecomment-1188740962 .

Environment information

Reproducibility

Always reproducible

Steps to reproduce

  1. In Xcode, open a view like ShowHeaderView.swift.
  2. Previews it.
pyby commented 2 years ago

For tvOS: AppCenterCrashes dependency has the noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable issue.

For iOS: AppCenterCrashes, AppCenterDistribute and GoogleCastSDK-ios-no-bluetooth dependencies have the noExecutablePath(<IDESwiftPackageStaticLibraryProductBuildable issue.

pyby commented 2 years ago

About AppCenter dependencies: Issue opened on the repository: https://github.com/microsoft/appcenter-sdk-apple/issues/2429

Importing the appcenter-sdk-apple in a local Packages-swift didn't fix it. The same error log is given.

The SDK has been forked and type: .static has been removed for library products. https://github.com/SRGSSR/appcenter-sdk-apple.git on develop.

SwiftUI previews build succeed again for tvOS platform.

pyby commented 2 years ago

We opened a radar to Apple as well, but as the issue is not on all SPM packages, I'm not sure that Apple will fix it.

pyby commented 2 years ago

About GoogleCast dependency:

The new player project http://github.com/SRGSSR/pillarbox-apple has a working SwiftUi previews build. The difference is that GoogleCastSDK-ios-no-bluetooth dependency is from an external swift package, not from the Xcode packages dependencies list.

Moving the dependency in a local swift packages fixed the SwiftUI previews build for iOS platform.

It's a workaround and we should understand why the real issue behind.