Dive into the vast array of tools and services available to developers.

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

Symbol not found: NSUserActivityTypeLiveActivity and WidgetCenter.UserInfoKey.activityID
The app I'm working on has iOS 16.0 as target. Recently Live Activities support was added, but then it started crashing when running on iOS 16.0 devices. After some investigation, I've found that the culprit was the presence of NSUserActivityTypeLiveActivity and WidgetCenter.UserInfoKey.activityID, even though they were inside an @available(iOS 17.2, *) block. If I comment these two variables, the app work as expected. I've also tried adding #if canImport(ActivityKit) around the code, but without success. But if the @available isn't working, how can I prevent this? It looks like a bug, since the documentation says that NSUserActivityTypeLiveActivity is supported but iOS 14.0+, but I'm pretty sure it was introduced on 16.1. This is the only output I get with the crash: dyld[66888]: Symbol not found: _$s9WidgetKit0A6CenterC11UserInfoKeyV10activityIDSSvgZ Referenced from: <D6EFF120-2681-34C1-B261-8F3F7B388238> /Users/<redacted>/Library/Developer/CoreSimulator/Devices/8B5B4DC9-3D54-4C91-8C88-E705E851CA0F/data/Containers/Bundle/Application/DB6671FF-CB07-4570-BD63-C851D94FAF29/<redacted>.app/<redacted>.debug.dylib Expected in: <C5E72BB5-533F-3658-A987-E849888F4DFC> /Library/Developer/CoreSimulator/Volumes/iOS_20A360/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 16.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/WidgetKit.framework/WidgetKit
0
0
77
Mar ’25
Debugging Mail extensions
I'm trying to rewrite an old AppleScript mail rule that I used extensively as a Mail extension using the MailKit framework and I've run into an issue. Previously, when developing the script, it was possible to debug it by selecting the message I wanted it applied to and choosing the Mail.app menu item "Message/Apply Rules" This would re-execute my script and I could iterate over it as many times as I liked while developing. I haven't found any great way of doing this for my extension with a MEMessageActionHandler. The closest I've found is to forward the message to myself and wait for it to come back in again over the internet, at which point the extension would get executed again. Needless to say, this makes debugging my MEMessageAction handler much slower. I've tried a number of things in Mail.app to try and get it to re-execute my extension with a particular message without any luck. Does anyone know of a good process for debugging a MEMessageActionHandler that doesn't involve forwarding the message to myself over and over and waiting for it to come in each time?
3
0
123
Mar ’25
App Freezing at Launch and Unexpected Termination
We are experiencing an issue where our app gets stuck during launch. The splash screen appears for some time, and then the app either becomes unresponsive or closes unexpectedly. However, there are no crash logs captured in Xcode or Firebase Crashlytics, indicating that the app is not crashing but rather being terminated. This issue is preventing affected users from properly launching the app. Additionally, some users have reported occasional lag and slow performance when using the app. The issue occurs only for a specific subset of users and appears to be related to other Electronic Logging Device (ELD) apps running in the background. When these apps are active, our app struggles to launch and sometimes becomes unresponsive. We suspect that this behavior could be related to system resource allocation, such as high memory consumption by background apps, which might be affecting our app's ability to launch correctly. However, we have been unable to reproduce the issue on our end despite multiple attempts. Actions Performed During App Launch: Firebase configuration API requests, including: Fetching account details Registering the FCM token with the server Asynchronous background requests to fetch POI details Creating a local database and storing POI data in local storage We would like guidance from Apple regarding potential causes and debugging strategies, especially in scenarios where the app does not produce crash logs but still fails to launch properly. Any insights into memory management, conflicts with background applications, or system resource constraints would be highly appreciated. Steps to Reproduce: Install and launch the app on an affected device. Observe that the app gets stuck on the launch screen. After some time, the app terminates unexpectedly. Issue is inconsistent and occurs only for certain users. Presence of other ELD apps running in the background appears to influence the issue.
3
0
255
Mar ’25
Crash reports downloaded by Xcode contain impossible call hierarchy
I was just having a look at some crash reports downloaded by Xcode, and I noticed the same wrong pattern I already mentioned here: the crash reports indicate that method A calls method B, which is impossible. In the first crash report below, method MainViewController.showSettings seems to be called by ConfirmMoveViewController.openSourceInFinder, which is impossible. ConfirmMoveViewController.openSourceInFinder is a context menu action in a modal window, and MainViewController.showSettings is in a completely different window and the two methods have no relation whatsoever. In the second crash report below, MainViewController.setSortMode is triggered by the press of a button (and nothing else) but seems to be called by OtherViewController.copy that can be triggered by a context menu (or keyboard shortcut). The two methods have no relation whatsoever. The rest of the stack trace confirm that it's indeed the button that was pressed. This seems to me like a quite serious bug in how macOS creates crash reports. 1.crash 2.crash
6
0
302
Mar ’25
Why does my zsh prompt permanently change?
Hey, I am using the terminal a lot. Since I updated to Sonoma (so, really a long time ago). My prompt or more precise the hostname always changes between three states. Sometimes it is username@Macbook-Pro-of-XXX, sometimes username@MacbookPro and sometimes it's username@xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbbbb. The latter is probably my UUID. Does anyone have a clue why this randomly changes?
0
0
61
Mar ’25
UI Test Cases Failing with Custom Accessibility Labels in SwiftUI
Hello Apple Developer Support, I am writing to seek assistance with an issue we are experiencing in our SwiftUI application concerning UI test cases. Our application uses accessibility labels that differ slightly from the display content to enhance VoiceOver support. However, we have encountered a problem where our UI test cases fail when the accessibility label does not match the actual display content. Currently, we are using accessibility identifiers in our tests, but they only retrieve the accessibility label, leaving us without a method to access the actual display content. This discrepancy is causing our automated tests to fail, as they cannot verify the visual content of the UI elements. We would greatly appreciate any guidance or solutions you could provide to address this issue. Specifically, we are looking for a way to ensure our UI tests can access both the accessibility label and the actual display content for verification purposes. For ex: Problem scenario - setting accessibilityLabel masks access to any displayed content If an accessibilityLabel is set on a UI element, then it seems to be no-longer possible to check/access the displayed content of that element: var body: some View { Text("AAA") .accessibilityIdentifier("textThing") .accessibilityLabel("ZZZ") // Different label from the text which is displayed in UI } // in test... func test_ThingExists() { XCTAssert(app.staticTexts["AAA"].exists) // Fails, cannot find the element XCTAssertEqual(app.staticTexts["ZZZ"].label, "AAA") // Fails - '.label' is the accessibilityLabel, not the displayed content XCTAssertEqual(app.staticTexts["ZZZ"].label, "ZZZ") // Passes, but validates the accessibility content, not the displayed content XCTAssert(app.staticTexts["textThing"].exists) // Passes, but does not check the displayed content XCTAssertEqual(app.staticTexts["textThing"].label, "AAA") // Fails - '.label' is the accessibilityLabel, not the displayed content XCTAssertEqual(app.staticTexts["textThing"].label, "ZZZ") // Passes, but validates the accessibility content, not the displayed content } element.label still only checks the accessibilityLabel. There is not, it seems, an way back to being able to check the content of the Text element directly. Thank you for your attention and support. We look forward to your valuable insights.
1
1
135
Mar ’25
iOS 18.3.1 - runtime vs version number
Not sure if this is common with releases but I've been doing some CI work recently so it's the first time I've seen this myself, When I list the runtimes installed on my machine: xcrun simctl list runtimes I notice the iOS 18.3.1 release has the below info: == Runtimes == iOS 18.3 (18.3.1 - 22D8075) - com.apple.CoreSimulator.SimRuntime.iOS-18-3 Meanwhile the other runtimes are listed as: == Runtimes == iOS 17.5 (17.5 - 21F79) - com.apple.CoreSimulator.SimRuntime.iOS-17-5 iOS 18.4 (18.4 - 22E5216h) - com.apple.CoreSimulator.SimRuntime.iOS-18-4 watchOS 11.2 (11.2 - 22S99) - com.apple.CoreSimulator.SimRuntime.watchOS-11-2 visionOS 2.3 (2.3 - 22N895) - com.apple.CoreSimulator.SimRuntime.xrOS-2-3 (Apologies for the weird formatting above, using code blocks and quote markdown condenses things down to one line for some reason) This is causing some funkiness in my CI code which I've managed to workaround, but wondered if this was a common thing, specifically the mismatch between the iOS name and the runtime version. iOS 18.3 and com.apple.CoreSimulator.SimRuntime.iOS-18-3 vs 18.3.1 - 22D8075 where the .1 has been dropped for the runtime names?
1
0
115
Mar ’25
Apollo GraphQL Error – MultipartResponseParsingInterceptor.ParsingError.cannotParseResponse in SwiftUI
I'm integrating Apollo GraphQL into a SwiftUI app and encountering the following error during a query execution: result : failure(Apollo.MultipartResponseParsingInterceptor.ParsingError.cannotParseResponse) failed : The response data could not be parsed. The request hits the server, but the response fails to be parsed by Apollo. I'm using the default code generation setup and executing a simple query to fetch a list of countries. Here’s a snippet of the function: swift Copy Edit private func fetchCountries() { switch result { case .success(let graphQLResult): if let name = graphQLResult.data?.countries { print(name) } else if let errors = graphQLResult.errors { print(errors) } case .failure(let error): print("failed : (error.localizedDescription)") } } This is run on an iPhone 16 Pro simulator with iOS 18.2. Any idea what's causing the parsing error or how I can inspect the raw response for debugging? Thanks in advance!
1
0
60
Mar ’25
The Xcode project keeps crashing on launch
Hello, I need a little bit of help. My game keeps crashing on launch no matter what I do. I’ve tried running it in Xcode on my Mac, on my iPhone, and through TestFlight, but I get the same result every time. I’ve tried everything I could find on the internet, and nothing worked. Asking here is my last resort because I’m completely stuck. The game runs fine in Unity, but not so much in Xcode. Can someone help me figure out what I’m doing wrong?Any help would be greatly appreciated. Here is the error log I found by connecting my iPhone to my Mac. To view the logs, I used the Console in the Devices and Simulators section of Xcode. ➤ SecKeyVerifySignature failed: Error Domain=NSOSStatusErrorDomain Code=-50 "rsa_pub_crypt failed" [10:27:36.034791+0200] kernel ➤ Sandbox: [App] deny(1) sysctl-read kern.bootargs [10:27:36.043389+0200] SpringBoard ➤ Live host view super view[(null)] not matching container view ➤ Frame not updated [10:27:36.050473+0200] backboardd ➤ Cycle detected [10:27:36.100799+0200] SpringBoard ➤ Live host view super view[(null)] not matching container view [10:27:36.538361+0200] akd ➤ Error fetching keychain item - Error Domain=NSOSStatusErrorDomain Code=-25300 "no matching items found" [10:27:36.545734+0200] akd ➤ Failed to set last known MID with error (Error Domain=NSOSStatusErrorDomain Code=-25300) [10:27:36.603384+0200] rtcreportingd ➤ Gap in hierarchy: [10:27:36.604536+0200] cloudd ➤ TCP input flags=[R.] state=LAST_ACK [10:27:36.613317+0200] cloudd ➤ TCP input flags=[R] state=CLOSED [10:27:36.648449+0200] kernel ➤ 1 duplicate report for Sandbox: [App] deny(1) sysctl-read kern.bootargs [10:27:36.648484+0200] kernel ➤ Sandbox: [App] deny(1) file-test-existence /private/var/Managed Preferences/mobile/com.apple.CoreMotion.plist [10:27:36.900275+0200] CommCenter ➤ Client is not entitled for request [10:27:37.131555+0200] storekitd ➤ AMSURLSession: Session decoder failed. Error = Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" [10:27:37.131761+0200] storekitd ➤ AMSURLSession: Task completed with error = Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" [10:27:38.137847+0200] kernel ➤ System Policy: [Process] deny(1) file-read-metadata /private/var/mobile/Library/Biome/FlexibleStorage [10:27:38.779536+0200] kernel ➤ Sandbox: [App] deny(2) file-test-existence /private/etc/localtime [10:27:38.942342+0200] mobileassetd ➤ TCP input flags=[R] state=LAST_ACK [10:27:38.963596+0200] kernel ➤ Sandbox: [App] deny(2) file-test-existence /bin/bash [10:27:40.152019+0200] mobileassetd ➤ TCP input flags=[R] state=LAST_ACK [10:27:40.280661+0200] assetsd ➤ Warning: cache_handle_memory_pressure invokedPreformatted text```
2
0
274
Mar ’25
Are watchdog timeout terminations a crash or not?
If an iOS app gets terminated by watchdog due to, for example, hanging the main thread, is that considered to be a crash or something different. I'm asking because, according to google and AI, Crashlytics can detect and report these,but in my experience it does not. If I deliberately cause a watchdog termination by for example sleeping on the main thread for a long time then these never appear in Crashlytics. I know Apple folks here don't comment on non Apple software, so I'm not asking about Crashlytics, just wondering and interested about watchdog timeout terminations and how they differ from a "regular" crash.
1
0
95
Mar ’25
Need guidance for creating the xcprivacy file WITHOUT A MAC when coding on flutter, especially when third party sdks are there.
When you have a mac, creating xcprivacy is pretty straightforward for your app, you simply use xcode, then select the sdks and target them and your privacy manifest is ready. In the other hand, when you are using CI/CD solutions you might not use xcode direclty. In that instance and if you are coding in flutter, you need to create your privacy manifest by hand. I would like guidance how to write that file, I would it for a given third party SDK and where to put that file in the flutter project (just to be sure) For example we choose the most important third party SDK manifest: FUTTER framework. I keep getting errors about it for my app, got alot of builds get the INVALID BINARY error because of that, and my mails indicating me a problem with the manifest. Please show me the source code of the manifest privacy for a project where a third party SDK is present (in particular: flutter sdk) Thanks
3
0
111
Mar ’25
NSUserDefaults + iPhone Transfer Issues
Hi! I was wondering if anyone else encountered similar issues and what the solution ended up being. We're encountering weird sign-in issues on our iOS version of our app. It seems like an uninstall and reinstall solves it, but the issue seems to only impact users who underwent the transfer process from one iOS device to another. What I am curious about: What is copied over from one device to another in this process? Is there a way outside of owning multiple test devices to replicate this flow? Our current suspicion is that NSUserDefaults is not being cleared by our app on first start, and that stale data is copied over during this transfer process, breaking the sign-in until a re-install wipes everything properly. Does it seem like we're on the right track with this assumption, or completely out to lunch?
2
0
61
Apr ’25
Interpreting crash log assertionFailure
Hello, I am experiencing crash on TopShelf and I checked all the crashlogs, but I don't know how to interpret it. I see only addresses in the trace logs, so it's really hard to understand what's going on. Is there a way how to symbolicate frames 5 - 17? Does anybody have an idea, what can be wrong? Thanks in advance. 0 libswiftCore.dylib 0x000000019bd33a88 _assertionFailure(_:_:file:line:flags:) + 264 (AssertCommon.swift:147) 1 TopShelf 0x00000001048b998c 0x1045ac000 + 3201420 2 TopShelf 0x0000000104cc04a8 0x1045ac000 + 7423144 3 libdispatch.dylib 0x000000019ab89294 _dispatch_client_callout + 20 (object.m:576) 4 libdispatch.dylib 0x000000019ab8aae0 _dispatch_once_callout + 32 (once.c:52) 5 TopShelf 0x00000001048f4098 0x1045ac000 + 3440792 6 TopShelf 0x00000001048f4930 0x1045ac000 + 3442992 7 TopShelf 0x00000001048cc8bc 0x1045ac000 + 3279036 8 TopShelf 0x00000001045b5a61 0x1045ac000 + 39521 9 TopShelf 0x0000000104ca8841 0x1045ac000 + 7325761 10 TopShelf 0x00000001049e5cc5 0x1045ac000 + 4431045 11 TopShelf 0x0000000104cc0dfd 0x1045ac000 + 7425533 12 TopShelf 0x00000001045b4b95 0x1045ac000 + 35733 13 TopShelf 0x00000001045b4e81 0x1045ac000 + 36481 14 TopShelf 0x00000001045b50e5 0x1045ac000 + 37093 15 TopShelf 0x00000001045b5a61 0x1045ac000 + 39521 16 TopShelf 0x00000001045b54b5 0x1045ac000 + 38069 17 TopShelf 0x00000001045b50e5 0x1045ac000 + 37093 18 libswift_Concurrency.dylib 0x000000019c30aedd completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1 (Task.cpp:497)
5
0
92
Apr ’25
Discrepancies in MetricKit and Xcode Organizer Data
We recently integrated MetricKit into our app; however, the 90th percentile data does not seem to match the data in Xcode Organizer. The values reported by MetricKit appear to be higher. Additionally, it looks like data for previous app versions is not being updated in Organizer as adoption of the latest version increases. Has anyone else experienced this issue? Could there be a delay in data updates for older versions in Organizer? Are there any known limitations or best practices for ensuring consistency between MetricKit and Xcode Organizer data? Any guidance would be greatly appreciated.
1
2
93
Apr ’25
Workbench Ad Tester not returning preview URLs
Apologies if this isn't tagged right but dev tools and services seemed the most appropriate since this is related to the workbench Ad Tester tool. I'm seeing a behavior where the preview link is not being generated. Specifically, I am seeing a POST request to the following URL consistently fail: https://iadworkbench.apple.com/adtester/api/v1/ads/previewLink?orgId=1127861 Variations/scenarios I have tried so far: All possible ad format choices on all possible devices All options for the placement type Both third party and uploaded creative sources Uploaded creative sources appear to be failing to upload as well A simple div with a "hello world" content fails as a third party creative source Multiple apple accounts I created a new account specifically to test if my primary apple ID was experiencing issues with this Multiple browsers I have tried multiple versions of Chrome/Firefox/Safari I tested with and without browser extensions to determine whether an extension was interfering or not Clearing session/local storage along with cookies I also created new profiles in browsers to verify that I was getting a fresh browser environment In all of these cases, the API request to generate a preview link is consistently failing with a 500 error code. It's worth noting that the web preview option works, but this isn't a truly accurate test environment and can't be solely relied on when testing ad content. I don't know exactly when this started happening as I have not used it in the last couple of weeks but I have used the workbench ad tester extensively in the past the same way I have been trying with my current test without issue. That coupled with the fact that the request for the preview link consistently fails in all of the test scenarios I've outlined above leads me to believe there is a problem with the API that is responsible for generating the preview links.
0
0
68
Apr ’25