Post

Replies

Boosts

Views

Activity

Reply to XCPreviewAgent crashed with some SwiftUI View
Hi, For your information, in Xcode 26 beta 5, the crash report provides some interesting new information. The crash occurred same with 'shared memory' Exception Subtype: KERN_PROTECTION_FAILURE at 0x000000038851ffd0 Exception Codes: 0x0000000000000002, 0x000000038851ffd0 VM Region Info: 0x38851ffd0 is in 0x38850c000-0x389a0c000; bytes after start: 81872 bytes before end: 21938223 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL shared memory 3884fc000-38850c000 [ 64K] rw-/rw- SM=SHM ---> shared memory 38850c000-389a0c000 [ 21.0M] rw-/rw- SM=SHM mapped file 389a0c000-38a8d8000 [ 14.8M] r-x/rwx SM=COW Object_id=c949d43b Termination Reason: SIGNAL 10 Bus error: 10 Terminating Process: exc handler [75426] However, the crash point provides even more information. 0 ??? 0x38851ffd0 ??? 1 RuntimeInternal 0x243f29ff8 _withConformanceCache(for:do:) + 240 2 ReflectionInternal 0x2428d7004 _typesThatConform(to:) + 148 3 PreviewsInjection 0x24178d7f0 0x241736000 + 358384 4 PreviewsServices 0x2418cf9a8 0x2418c6000 + 39336 5 PreviewsInjection 0x24174f0d9 0x241736000 + 102617 6 PreviewsServices 0x2418cf921 0x2418c6000 + 39201 7 PreviewsInjection 0x24178d295 0x241736000 + 357013 8 PreviewsInjection 0x241786141 0x241736000 + 328001 9 PreviewsInjection 0x241785bd1 0x241736000 + 326609 10 PreviewsInjection 0x24173f47d 0x241736000 + 38013 11 PreviewsInjection 0x241739475 0x241736000 + 13429 12 PreviewsInjection 0x241763325 0x241736000 + 185125 13 PreviewsInjection 0x24176a2d9 0x241736000 + 213721 14 PreviewsInjection 0x24176bb79 0x241736000 + 220025 15 PreviewsInjection 0x241739475 0x241736000 + 13429 16 PreviewsInjection 0x241739475 0x241736000 + 13429 17 libswift_Concurrency.dylib 0x258e99ee5 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’25
Reply to XCPreviewAgent crashed with some SwiftUI View
As I mentioned, within the same package, preview works for a file in one target, but a file in another target throws the error mentioned above. It seems like a memory violation issue, but it's been difficult to find a reliable way to reproduce it. We'd like to share our code, but due to security constraints, that's not easy. We're looking for an alternative way to reproduce the issue. Are there any plans to fix memory-related preview issues in Beta 5?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’25
Reply to SwiftUI Preview Runtime linking failure
No it's private package. In our package, We have several 3rd party maps and these maps are compiled with the predefined settings in Xcode and the google map is one of them. Due to security reasons, we cannot share the internal structure. However, when Google Maps is required, it is added as a target in the project, as shown below. static var google = PackageDescription.Package.Dependency.package( url: "https://github.com/googlemaps/ios-maps-sdk.git", from: "8.4.0" ) ... ... ... static var google: [PackageDescription.Target] = [ .target( name: .google, dependencies: [ .byName(name: .core), .product(name: "GoogleMaps", package: "ios-maps-sdk"), .product(name: "GoogleMapsBase", package: "ios-maps-sdk"), .product(name: "GoogleMapsCore", package: "ios-maps-sdk") ], resources: [ .copy("Theme/dark.json") ] ) ]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25
Reply to SwiftUI Preview Runtime linking failure
As you said, GoogleMaps.a is not a static library when I check it with lipo -info GoogleMaps.a the result is Architectures in the fat file: GoogleMaps.a are: x86_64 arm64 And I'm using GoogleMaps v8.3.0 as the package's dependency and it produces a same result when I change it to v9.3. But it works when I make a new project and only add GoogleMaps with dependencies not package's dependencies and both results are the universal object GoogleMaps.a not the static library. FYI, I found GoogleMapsTarget.o which is static library in the same directory where the GoogleMaps.a is. Finally when I change GoogleMaps.a to .o Xcode regenerates GoogleMaps.a and produces results == PREVIEW UPDATE ERROR: FailedToLaunchAppError: Failed to launch previews.com.apple.PreviewAgent.iOS ================================== | [Remote] JITError | | ================================== | | | [Remote] CouldNotLoadInputStaticArchiveFile: Could not load static archive during preview: /Users/***/Library/Developer/Xcode/DerivedData/BOA-eiluspltxasszsfkpqrnnsxsjhth/Build/Products/Debug_BOA_Inhouse-iphonesimulator/PackageFrameworks/GoogleMaps.a | |
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25
Reply to SwiftUI Preview Runtime linking failure
Hi, My Xcode is 16.3.1 (beta) and simulator is 18.4 (beta) but xcframeworks break again. But interest things are GMS* which is related with google maps. [Remote] JITError: Runtime linking failure Additional Link Time Errors: Symbols not found: [ _OBJC_CLASS_$_GMSStyleSpan, _OBJC_METACLASS_$_GMSMapView, _OBJC_CLASS_$_GMSPolyline, _OBJC_CLASS_$_GMSCoordinateBounds, _GMSStyleSpans, _OBJC_CLASS_$_GMSStrokeStyle, _OBJC_CLASS_$_GMSMapView, _OBJC_CLASS_$_GMSMapViewOptions, _OBJC_CLASS_$_GMSMapStyle, _OBJC_CLASS_$_GMSMutablePath, _OBJC_CLASS_$_GMSPolygon, _OBJC_CLASS_$_GMSCircle, _OBJC_CLASS_$_GMSCameraPosition, _OBJC_CLASS_$_GMSMarker, _OBJC_CLASS_$_GMSServices ] Symbols not found: [ _ogg_stream_flush, _ogg_stream_packetin, _ogg_stream_packetout, _opus_packet_get_nb_frames, _opus_multistream_decoder_ctl, _opus_multistream_decoder_create, _ogg_stream_init, _opus_multistream_decoder_destroy, _ogg_sync_pageout, _opus_strerror, _opus_decode, _ogg_sync_clear, _ogg_stream_pageout, _ogg_sync_init, _opus_packet_get_samples_per_frame, _ogg_page_granulepos, _ogg_stream_reset_serialno, _opus_decoder_create, _opus_multistream_decode_float, _ogg_sync_wrote, _ogg_page_serialno, _ogg_stream_pagein, _ogg_stream_clear, _ogg_sync_buffer ] Symbols not found: [ _OBJC_IVAR_$_VKPlayerControllerBase._imgViewAudioOnly, _OBJC_IVAR_$_VKPlayerControllerBase._panelIsHidden, _OBJC_IVAR_$_VKPlayerControllerBase._initialPlaybackTime, _OBJC_METACLASS_$_VKPlayerControllerBase, _OBJC_IVAR_$_VKPlayerControllerBase._decoderState, _OBJC_IVAR_$_VKPlayerControllerBase._contentURLString, _OBJC_IVAR_$_VKPlayerControllerBase._backgroundColor, _OBJC_IVAR_$_VKPlayerControllerBase._view, _OBJC_IVAR_$_VKPlayerControllerBase._delegate, _errorText, _OBJC_IVAR_$_VKPlayerControllerBase._decodeManager, _OBJC_IVAR_$_VKPlayerControllerBase._durationTotal, _OBJC_IVAR_$_VKPlayerControllerBase._durationCurrent, _OBJC_CLASS_$_VKPlayerControllerBase, _OBJC_IVAR_$_VKPlayerControllerBase._snapshotReadyToGet, _OBJC_IVAR_$_VKPlayerControllerBase._statusBarHiddenBefore, _log_level, _OBJC_IVAR_$_VKPlayerControllerBase._statusBarHidden ]
Mar ’25
Reply to The behavior of onDrag and onDrop in iOS 18 is different from previous versions.
Ok, here is the snippet. import SwiftUI struct ContentView: View { @State var str: String = "Drag me" var body: some View { VStack(spacing: 100) { Text(str) .frame(width: 100, height: 100) .background(.blue) .onDrag { NSItemProvider(object: String(str) as NSString) } VStack { Text("Drop Here!") } .frame(width: 200, height: 200) .background(.red) .onDrop(of: [.text], delegate: MyDelegate()) } } } struct MyDelegate: DropDelegate { func performDrop(info: DropInfo) -> Bool { return true } } #Preview { ContentView() }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’24