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

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

Simulator crash Exception Type: EXC_CRASH (SIGKILL) WatchDog: 0x8BADF00D
Hello, My app often crashes when I use simulators. I would like some help with reading the crash report that is generated. Especially with the part below Thread 0 Crashed. Based on other posts I understand that the 0x8BADF00D in the crash report is a WatchDog crash that basically says that WatchDog terminated the app because the main thread was blocked for a significant time. Many processes can block the main thread so it's hard to find out what it is in our specific case. Can someone help me reading through the crash report? Short_crash_report.txt Background information The application is Xamarin Native and I use Rider as an IDE. When I use Visual Studio, the simulators run just fine. No crash occurs while using my app on a device. The crash happens on multiple simulators with different OS versions. I already deleted XCode cache, erased content and settings of several simulators and deleted iOS DeviceSupport files.
1
0
515
Feb ’25
On passing the filename with spaces encoded with stringByAddingPercentEncodingWithAllowedCharacters to [NSFileManager fileExistsAtPath:], the path is not converted back to the decoded file name and returning false.
We have a Push-To-Talk application, which also allow user's to share the PDF file documents. On receiving a PDF file document, which has a space in its file name. On saving the document in the DB with space. When user is trying to access the PDF file, in order to rule out issues where there can be special character's in its file name, we are encoding the file name using stringByAddingPercentEncodingWithAllowedCharacters, and URLPathAllowedCharacterSet is the character set used which converts space character (" ") to %20. Later, path of the same encoded file name is sent to fileURLWithPath:. When the encoded URL is passed to [NSFileManager fileExistsAtPath:] the file is not found in the since in DB, file is saved with a space, but in the URL %20 is been swapped in-place of space character. Issue case: Here, on passing the same encoded URL path of the PDF file to [NSFileManager fileExistsAtPath:] is returning false; Query: On passing the filename with spaces encoded with stringByAddingPercentEncodingWithAllowedCharacters to [NSFileManager fileExistsAtPath:], the path is not converted back to the decoded file name and returning false We have used a work around on this case, by forming the URL of the PDF file without encoding and passing it to fileURLWithPath, issue is not seen here. We have a query here, i.e. will fileURLWithPath will be able to handle different special characters without encoding. We have also raised a Feedback Ticket on same: https://feedbackassistant.apple.com/feedback/16049504
1
0
368
Dec ’24
SwiftMacros Not able to access of main project XCTest File.
I have developed a Swift macro called @CodableInit in the SwiftCodableMacro module, and I’m able to use it successfully in my main project. Here’s an example usage: import SwiftCodableMacro @CodableInit // This is for Codable macros public class ErrorMonitoringWebPlugin { public var identifier: UUID = UUID() // MARK: - Codable required public init(from decoder:Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) identifier = try values.decode(UUID.self, forKey: .identifier) } } However, when I try to write a unit test for the ErrorMonitoringWebPlugin class, I encounter an issue. Here's the test case: func testCodableSubjectIdentifierShouldEqualDecodedSubjectIdentifier() { self.measure { let encoder = JSONEncoder() let data = try? encoder.encode(subject) //Here I am getting this error Class 'JSONEncoder' requires that 'ErrorMonitoringWebPlugin' conform to 'Encodable' let decoder = JSONDecoder() let decodedSubject = try? decoder.decode(ErrorMonitoringWebPlugin.self, from: data!) XCTAssertEqual(subject.identifier, decodedSubject?.identifier) } } The compiler throws an error saying: Class 'JSONEncoder' requires that 'ErrorMonitoringWebPlugin' conform to 'Encodable' Even though the @CodableInit macro is supposed to generate conformance, it seems that this macro-generated code is not visible or active inside the test target. How can I ensure that the @CodableInit macro (from SwiftCodableMacro) is correctly applied and recognized within the XCTest target of my main project?
0
0
58
Jun ’25
Unable to deploy app from Visual Studio on Windows 11 to iOS device
I am trying to get my app deployed to an iOs device (iphone 14) from Visual Studio on Windows 11. If the device I am trying to deploy to is included in https://developer.apple.com/account/resources/devices/list then I see below error in Visual Studio logs. Xamarin.Messaging.IDB.AppleProvisioningManager Error: 0 : Xamarin.MacDev.AppleSigning.AppleServerException: A device with number '0000xxxx-0014093926Bxxxx' already exists on this team. at Xamarin.MacDev.AppleSigning.AppStoreDeveloperPortal.d__42.MoveNext() in D:\a_work\1\s\External\maciostools\Xamarin.MacDev.AppleSigning\AppleDeveloperPortal\AppStoreDeveloperPortal.cs:line 913 If I disable it I see below error in Visual Studio logs: Xamarin.Messaging.Client.MessagingClient Error: 0 : An error occurred on the receiver while executing a post for topic xvs/idb/auto-provision and client vs26896sv3 Xamarin.Messaging.Exceptions.MessagingRemoteException: An error occurred on client xxxxxxx while executing a reply for topic xvs/idb/auto-provision ---> Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.DateTime'. Path 'data.attributes.addedDate', line 6, position 24 I am seeing no option to completely remove the device from the list. How can this issue be fixed?
0
0
250
Jan ’25
memory leak in dlopen / dlcose, or user error?
Calling dlopen then dlclose causes an increase in the amount of memory used by the program. If I create a loop that calls dlopen / dlclose repeatedly on the same dynamic library, memory usage increases continuously. Is this a bug, or am I using dlopen / dlclose incorrectly? I can reproduce this by modifying the sample code in the Apple Developer docs Creating Dynamic Libraries. If I modify Runtime.c, changing the line void *lib_handle = dlopen(lib_name, RTLD_NOW); to add the infinite loop, as below: void *lib_handle = dlopen(lib_name, RTLD_NOW); for (int ii = 0; ; ++ii) { printf("loop %i\n", ii); int close_err = dlclose(lib_handle); printf("close error: %i\n", close_err); printf("dlopen(%s, RTLD_NOW)\n", lib_name); lib_handle = dlopen(lib_name, RTLD_NOW); } then opening and closing the dynamic library will succeed, but memory usage (as reported by top) will rapidly increase. I'm running on x86_64 macOS 13.6.6. Full code for the modified Runtime.c is attached, the rest of the code is available in the Apple Developer docs. Any suggestions? Many thanks, Chris Runtime.c
0
0
12
10h
Static Framework from existing project
Good day, everyone. I've already spent two days trying to figure out if this is even possible: I have a working project with a huge number of SPM dependencies. We need to wrap all of this into a framework that can be easily connected to another project. Currently, following the instructions on Apple's documentation, I've done everything step by step. However, after connecting the library to a new project and writing import Framework, I get the error: Missing required modules: [list of all SPM from Framework] I thought that a static framework implied that all dependencies would be bundled into the project, but that didn't happen. Are there any ways to solve this problem? Thank you!
1
0
228
Jan ’25
iOS 18.5 crash with iPad 7 only
Weirdness going on here. Our app is crashing on startup with iPad 7s running iOS 18.5. Before updating to iOS 18.5, it was working fine on iPad 7s. Even with iOS 18.5, it is working fine on every device we have tried including dozens of other iPads and iPhones. We have narrowed it down to the SquareReaderSDK. If we remove that SDK, it will launch and work without issues. But, many of our users need the SquareReaderSDK. The crash happens at app load, before appDelegate didFinishLaunchingWithOptions. So we can't figure out any way to debug the issue. Is anyone else having a similar issue? Square thinks it is an Apple issue.
4
0
105
Jun ’25
C compilation problem
Hi Would someone happen to know how to solve the problem when installing Concorde.jl in julia: (@v1.11) pkg> add Concorde Resolving package versions... No Changes to ~/.julia/environments/v1.11/Project.toml No Changes to ~/.julia/environments/v1.11/Manifest.toml Precompiling project... ✗ Concorde 0 dependencies successfully precompiled in 2 seconds. 238 already precompiled. 1 dependency errored. For a report of the errors see julia> err. To retry use pkg> precompile (@v1.11) pkg> build Concorde Building Concorde → ~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/5d9f1b1a480235ffdd3c8ab8cab011aa9afe81af/build.log ERROR: Error building Concorde, showing the last 100 of log: x ./concorde/TOOLS/prob2tsp.c x ./concorde/TOOLS/showres.c ... x ./concorde/VERIFY/Makefile.in x ./concorde/README loading cache ./config.cache checking host system type... Invalid configuration darwin': machine darwin' not recognized checking for prespecified compiler options... no checking for gcc... (cached) gcc checking whether the C compiler (gcc -fPIC -O2 -g ) works... no configure: error: installation or configuration problem: C compiler cannot create executables. ERROR: LoadError: failed process: Process(bash -c "CFLAGS='-fPIC -O2 -g' ./configure --with-qsopt=/Users/poss/.julia/packages/Concorde/VRfqN/deps/qsopt --host=darwin", ProcessExited(1)) [1] It seems to be related to the M3 processor as I have the same error on another Mac with that processor, while the M2 I tried on could install the package properly. It is related to my C compiler, but the latter works, despite the error "checking whether the C compiler (gcc -fPIC -O2 -g ) works... no" poss@Mac-de-Michael ~ % gcc --version Apple clang version 16.0.0 (clang-1600.0.26.6) Target: arm64-apple-darwin24.1.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin poss@Mac-de-Michael ~ % gcc -fPIC -O2 -g test.c Best, Michaël.
0
0
207
Feb ’25
MetricKit Metric Payload Split
In MetricKit, a metric payload comes in with a time range which usually means it contains multiple launches/sessions. How can we relate things that will change between launches or sessions such as pid and lowPowerModeEnabled from the metadata. Will there be multiple payloads for each unique value or is there some other way to use this?
2
0
51
5d
Missing Apple-Hosted Background Assets info
After combing the forums and release nodes, here are some extra notes to help other developers using Apple-Hosted Background Assets. I don't promise I got this perfect, but it may help direct you. AssetPack.Status is an OptionSet (not an enum!) - Critical API detail missing from guide It's a bitmask where values can be combined 2⁰ (1) = available to download 2¹ (2) = update available 2² (4) = up to date 2⁶ (64) = downloaded Example: status value 69 = 0b1000101 = available + up to date + downloaded Use .contains() method to check specific flags AssetPack.version property - Undocumented feature Auto-assigned by App Store Connect for Apple-hosted packs Increments with each upload of same asset pack ID No file deduplication across asset packs Same file in two packs = counts twice toward 200GB limit Best practice: create separate pack for shared files Shared namespace path requirements Asset pack ID is NOT part of file path Each file must have unique relative path across ALL app's asset packs Example: Foo/10/239/414.png and Bar/10/239/414.png are distinct and won't collide Additional url(for:) bugs beyond iOS 26.1 fix iOS 26 Beta 5: "item with same name already exists" error Workaround: Request URL for directory, then manually append filename TestFlight-only availability - Major limitation not mentioned! Apple-hosted packs currently ONLY work for internal testers on TestFlight or from App Store. Won't work from Xcode until "later this year" HTTP 400 errors expected for non-TestFlight installs ba-serve port workaround URL override port bug exists on multiple device types Use ba-serve -p 443 instead of custom ports
1
0
226
1w
On Demand Resources does not show an error
I am integrating On Demand Resources into my Unity game. The resources install without any problems if the internet connection is stable: all resources are installed. While testing various scenarios without an internet connection, I encountered the following problem: if I turn off the internet during installation, I don't get any error messages, but if I turn the internet back on, the download no longer continues (and I still don't get an error). If I reopen the application with a stable internet connection, the download will always be at 0%. Please tell me what I am doing wrong. #import "Foundation/Foundation.h" #if ENABLE_IOS_ON_DEMAND_RESOURCES #import "Foundation/NSBundle.h" #endif #include <string.h> struct CustomOnDemandResourcesRequestData; typedef void (*CustomOnDemandResourcesRequestCompleteHandler)(struct CustomOnDemandResourcesRequestData* handler, const char* error); #if ENABLE_IOS_ON_DEMAND_RESOURCES struct CustomOnDemandResourcesRequestData { NSBundleResourceRequest* request; }; extern "C" CustomOnDemandResourcesRequestData* CustomOnDemandResourcesCreateRequest(const char* const* tags, int tagCount, CustomOnDemandResourcesRequestCompleteHandler handler) { NSMutableArray* tagArray = [NSMutableArray array]; for (int i = 0; i < tagCount; i++) { const char* tag = tags[i]; if (tag != NULL) { [tagArray addObject:[NSString stringWithUTF8String:tag]]; } } NSSet* tagSet = [NSSet setWithArray:tagArray]; CustomOnDemandResourcesRequestData* data = new CustomOnDemandResourcesRequestData(); data->request = [[NSBundleResourceRequest alloc] initWithTags:tagSet]; [data->request beginAccessingResourcesWithCompletionHandler:^(NSError* error) { dispatch_async(dispatch_get_main_queue(), ^{ const char* errorMessage = error ? [[error localizedDescription] UTF8String] : NULL; handler(data, errorMessage); }); }]; return data; } extern "C" void CustomOnDemandResourcesRelease(CustomOnDemandResourcesRequestData* data) { [data->request endAccessingResources]; delete data; } extern "C" float CustomOnDemandResourcesGetProgress(CustomOnDemandResourcesRequestData* data) { return data->request.progress.fractionCompleted; } extern "C" float CustomOnDemandResourcesGetLoadingPriority(CustomOnDemandResourcesRequestData* data) { float priority = (float)data->request.loadingPriority; return priority; } extern "C" void CustomOnDemandResourcesSetLoadingPriority(CustomOnDemandResourcesRequestData* data, float priority) { if (priority < 0.0f) priority = 0.0f; if (priority > 1.0f) data->request.loadingPriority = NSBundleResourceRequestLoadingPriorityUrgent; else data->request.loadingPriority = (double)priority; } extern "C" const char* CustomOnDemandResourcesGetResourcePath(CustomOnDemandResourcesRequestData * data, const char* resource) { NSString* resourceStr = [NSString stringWithUTF8String: resource]; NSString* path = [[data->request bundle] pathForResource: resourceStr ofType: nil]; if (path == nil) { return NULL; // или другое значение по умолчанию } const char* result = strdup([path UTF8String]); // копируем строку return result; // в C# нужно будет освободить память } extern "C" void CustomOnDemandResourcesFreeString(const char* str) { free((void*)str); } #else // ENABLE_IOS_ON_DEMAND_RESOURCES struct CustomOnDemandResourcesRequestData { }; extern "C" CustomOnDemandResourcesRequestData* CustomOnDemandResourcesCreateRequest(const char* const* tags, int tagCount, CustomOnDemandResourcesRequestCompleteHandler handler) { CustomOnDemandResourcesRequestData* data = new CustomOnDemandResourcesRequestData(); if (handler) handler(handlerData, NULL); return data; } extern "C" void CustomOnDemandResourcesRelease(CustomOnDemandResourcesRequestData* data) { delete data; } extern "C" float CustomOnDemandResourcesGetProgress(CustomOnDemandResourcesRequestData* data) { return 0.0f; } extern "C" float CustomOnDemandResourcesGetLoadingPriority(CustomOnDemandResourcesRequestData* data) { return 0.0f; } extern "C" void CustomOnDemandResourcesSetLoadingPriority(CustomOnDemandResourcesRequestData* data, float priority) { } extern "C" const char* CustomOnDemandResourcesGetResourcePath(CustomOnDemandResourcesRequestData * data, const char* resource) { return NULL; } extern "C" void CustomOnDemandResourcesFreeString(const char* str) { } #endif // ENABLE_IOS_ON_DEMAND_RESOURCES
0
0
50
2w
CoreHaptics.AssetPickerDrawer throws exceptions and draws incorrectly when fieldInfo or assetType is null
There is a bug in Unity Plugins: Corehaptics.AssetPickerDrawer throws exceptions and draws incorrectly when fieldInfo or assetType is null (FB17305973). I fixed it and created a pull request: https://github.com/apple/unityplugins/pull/47 It has been months and this bug is really annoying.
0
0
58
Jun ’25
MailCore.swift
Hi, is there a compiled version of MailCore.swift? I want to build an easy-to-use mail app for my mother, who is 97, has a MacBook Air, but Apple Mail is too complicated for her. chatGPT said I am too stupid to compile it by myself. Regards Stephan
0
0
48
2w
On demand module download
I am working on an iOS app and I want to achieve on demand module download inside the app when the user clicks on the module icon which he wants to use. The idea is that we have a super app consisting of multiple modules say four independent apps/features and I want to separate each one so that when the user selects a specific app/feature, it’s downloaded on demand and then opened directly within the same super app resulting in a lower app size initially I want to upload all the code of all modules to app store connect but when the user downloads the app, then only one module's code should be available to the user, the rest of the module's code should be downloaded when the user wants to use that module. I know apple restricts downloading new code but in my case I want to upload all the code to app store for review but just give option to the user to get rest of the code when needed. Any guidance, architectural advice, or example implementations would be highly appreciated.
1
0
69
2w
Flutter IOS deep links
Hello all, I am building a simple Flutter app, and I want to support entering the app through an email. I have used flutter deep links on android and all works well, but for some reason on IOS it doesnt. What I have achieved: When clicking the link I do get navigated into the app, but I get navigated to whatever the last screen was, regardless of the path in the URL. Furthermore, the logical code inside the app doesnt seem to run either - no logs are printed etc. I have even tried following the flutter tutorial at https://docs.flutter.dev/cookbook/navigation/set-up-universal-links to the letter, and it doesnt work I am using: Flutter 3.22.3 Go Router 14.2.7 Thanks in advance
1
0
179
Feb ’25