I’m currently working on an app that supports iOS 15, and I know for a fact that there are users that have iPhone SE (1st gen), which is a really small screen.
I’m building SwiftUI views and I want to make sure that they look good on that small screen as well, but I’m unable to run the canvas preview on iPhone SE. Canvas works perfectly fine for other devices that run iOS 17, but when selecting an older device it crashes, however the app builds without problems on iOS 15 devices and simulators, it’s just preview that isn’t working.
Selecting different build targets does not help either, as well as choosing older preview methods.
struct LoginViewNew_Previews: PreviewProvider {
static var previews: some View {
Group {
Text("Test preview")
}
}
}
#Preview {
Group {
Text("Test preview")
}
}
Both of these produce the same result.
Error message I’m getting is:
== PREVIEW UPDATE ERROR:
PotentialCrashError: Update failed
App may have crashed. Check ~/Library/Logs/DiagnosticReports for any crash logs from your application.
==================================
| HumanReadableSwiftError
|
| PropertyListError: Property list missing value for required key ”contentPayload”
| Property list: ["selectableRegions": <__NSArray0 0x1e0383a00>(
|
| )
| , "snapshotCornerRadius": 0, "bitmapDescription": {
| byteOrder = little;
| bytesPerRow = 2560;
| data = {length = 2916352, bytes = 0xffffffff ffffffff ffffffff ffffffff ... 00000000 00000000 };
| height = 1136;
| width = 640;
| }]
== ERROR:
PotentialCrashError: Update failed
App may have crashed. Check ~/Library/Logs/DiagnosticReports for any crash logs from your application.
==================================
| HumanReadableSwiftError
|
| PropertyListError: Property list missing value for required key ”contentPayload”
| Property list: ["selectableRegions": <__NSArray0 0x1e0383a00>(
|
| )
| , "snapshotCornerRadius": 0, "bitmapDescription": {
| byteOrder = little;
| bytesPerRow = 2560;
| data = {length = 2916352, bytes = 0xffffffff ffffffff ffffffff ffffffff ... 00000000 00000000 };
| height = 1136;
| width = 640;
| }]
== VERSION INFO:
Tools: 15E204a
OS: 23D60
PID: 71598
Model: MacBook Pro
Arch: arm64e
== ENVIRONMENT:
openFiles = [
/Users/user/Projects/App/ios-app/App/Scenes/Onboarding/Login/LoginView.swift
]
wantsNewBuildSystem = true
newBuildSystemAvailable = true
activeScheme = Ap DE
activeRunDestination = Any iOS Device variant iphoneos undefined_arch
workspaceArena = [x]
buildArena = [x]
buildableEntries = [
App.ap
]
runMode = Dynamic Replacement
== SELECTED RUN DESTINATION:
name = Any iOS Device
eligible = true
sdk = Optional(<DVTSDK:0x154f25aa0:'iphoneos17.4':iOS 17.4:<DVTFilePath:0x6000002aba00:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk'>>)
variant = Optional("iphoneos")
device = Optional(<DVTiPhonePlaceholder: 0x154fd2950 (Any iOS Device | undefined_arch)>)
== SELECTED RUN DESTINATION:
Generic | iOS 17.4 | iphoneos | undefined_arch | GenericiOS | no proxy
Unfortunately I couldn’t find any useful info on this error, and I have no idea what to try, so any help or guide would be greatly appreciated!
Project min. deployment target is iOS 15.
Tried previewing SwiftUI view on iPhone SE (1st gen), preview crashed with “Property list missing value for required key ”contentPayload”” error.