Posts under Developer Tools & Services topic

Post

Replies

Boosts

Views

Activity

PHAssetChangeRequest deleteAssets not working some time
Hello Team, I try to delete photo from Photos for that i used this method, [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ [PHAssetChangeRequest deleteAssets:@[assetToDelete]]; completionHandler:^(BOOL success, NSError *error) { }]; This method pops up a dialog with Don't Allow or Delete. But some time in some iPhones not respond PHAssetChangeRequest deleteAssets method that's why that completionHandler not called because of that i can't perform any operation of PHPhotoLibrary then after. If I restart my iPhone then it works. Many users of my app complained about this issue. I have an iPhone 11 with iOS 15.3. But some iOS 12,14,16 users also face the same issue. So what exact issue is there? Is it related to iOS or a method? Thanks, Ankur
2
3
860
5d
Xcode 26 Compiler Critical Issues?
Hello everyone, Since I installed Xcode 26, I've been encountering issues I've never seen before. I have Mac OS applications written in Objective-C, some released as far back as 14 years ago. When compiling them with Xcode 26, I experience efficiency issues related to thread management and interface updates. There are rendering problems with a simple NSTextView created through Interface Builder. The issue is not easily reproducible as it occurs randomly on some machines, regardless of their architecture or macOS version. The main thread freezes, and generally after 15-30 seconds, it unfreezes, loading the interface and text. The length of the text is irrelevant to the issue, and no crashes occur. I spent ten days trying to optimize the code and change the loading order within the class, but the problem persists. However, if I compile the application with Xcode 16.4, everything works like a charm. I also tried using the macOS 15.5 SDK to compile with Xcode 26, but it doesn’t resolve any issues. Additionally, I tried changing the compiler optimization level, but it didn’t solve the problem. This leads me to believe it’s an issue with the Xcode 26 compiler. If it were a code issue, it would be easily reproducible and would also occur when compiling with 16.4. The Xcode 26.1 Beta doesn’t resolve the issue. Can anyone tell me if I need to change something related to the compiler? Are you aware of any issues like this? Thank you, Luca
0
1
64
5d
realitytool requires Metal for this operation and it is not available in this build environment
Hello, I'm getting started for my project with Xcode Cloud since I upgraded to the macOS Sequioa Beta and Xcode 16 now refuses to archive builds for TestFlight. Somewhere very late in the build process I get the following error: realitytool requires Metal for this operation and it is not available in this build environment The log says this happens at: Compile Skybox urban.skybox My project uses RealityKit. How can I fix this issue? Thanks!
5
5
876
5d
How to debug ios Webkit crash
We have an iphone app that has an embedded webview using webkit, and we found the app crashes when we navigate to an specifc internal website. When I opened the ips file I see this stacktrace on the com.apple.main-thread WebCore::JSDOMRect::subspaceForImpl(JSC::VM&) WebCore::JSDOMRect::create(JSC::Structure*, WebCore::JSDOMGlobalObject*, WTF::Ref<WebCore::DOMRect, WTF::RawPtrTraits<WebCore::DOMRect>, WTF::DefaultRefDerefTraits<WebCore::DOMRect>>&&) WebCore::toJSNewlyCreated(JSC::JSGlobalObject*, WebCore::JSDOMGlobalObject*, WTF::Ref<WebCore::DOMRect, WTF::RawPtrTraits<WebCore::DOMRect>, WTF::DefaultRefDerefTraits<WebCore::DOMRect>>&&) JSC::JSValue WebCore::CloneDeserializer::readDOMRect<WebCore::DOMRect>() WebCore::CloneDeserializer::readTerminal() WebCore::CloneDeserializer::deserialize() WebCore::SerializedScriptValue::deserialize(JSC::JSGlobalObject&, JSC::JSGlobalObject*, WTF::Vector<WTF::Ref<WebCore::MessagePort, WTF::RawPtrTraits<WebCore::MessagePort>, WTF::DefaultRefDerefTrait WebCore::SerializedScriptValue::deserialize(JSC::JSGlobalObject&, JSC::JSGlobalObject*, WebCore::SerializationErrorMode, bool*) WebCore::SerializedScriptValue::deserialize(OpaqueJSContext const*, OpaqueJSValue const**) API::SerializedScriptValue::deserialize(WebCore::SerializedScriptValue&) ScriptMessageHandlerDelegate::didPostMessage(WebKit::WebPageProxy&, WebKit::FrameInfoData&&, API::ContentWorld&, WebCore::SerializedScriptValue&) WebKit::WebUserContentControllerProxy::didPostMessage(WTF::ObjectIdentifierGeneric<WebKit::WebPageProxyIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits<unsigned long long>, unsigned lon WebKit::WebUserContentControllerProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) WebKit::WebProcessProxy::dispatchMessage(IPC::Connection&, IPC::Decoder&) WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) IPC::Connection::dispatchMessage(WTF::UniqueRef<IPC::Decoder>) IPC::Connection::dispatchIncomingMessages() WTF::RunLoop::performWork() WTF::RunLoop::performWork(void*) __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ __CFRunLoopDoSource0 __CFRunLoopDoSources0 __CFRunLoopRun CFRunLoopRunSpecific GSEventRunModal -[UIApplication _run] UIApplicationMain main start I assume something is crashing after deserializing a JSDomRect. This is crashing on an Iphone 13 with os 18.6.2 but this doesn't crash on iphone 11 os 26.0 I'm executing the app from xcode and I'm not able to see the stacktrace listed before in xcode, to be able to see variables and to understand what is being deserialized. I've also tried using safari mac develop, but safari stops debugging as soon as the app crashes. I've also tried attaching a remote process into the webkit I've downloaded from here https://webkit.org/getting-the-code/ but didn't have luck so far. Do you know how can I debug what's causing the crash?
3
0
72
5d
Bogus include directories in Xcode 26
I've recently switched from using Xcode 15 under Ventura to using Xcode 26 under Sequoia on an Intel-CPU Mac. This is a macOS project that uses a legacy build location, and the sources are C++ and Objective-C. For every source being compiled, I get a clang warning "no such include directory" for these 4 directories: $BUILD_DIR/Debug/include $BUILD_DIR/SBEngineV4.build/Debug/V4 Dual SBEngine.build/DerivedSources-normal/x86_64 $BUILD_DIR/SBEngineV4.build/Debug/V4 Dual SBEngine.build/DerivedSources/x86_64 $BUILD_DIR/SBEngineV4.build/Debug/V4 Dual SBEngine.build/DerivedSources I can't figure out where it's getting those directories. I added a Run Script build phase that says echo $HEADER_SEARCH_PATHS, and the first path that reports is the $BUILD_DIR/Debug/include path, yet I don't see that when I look at the header search paths in the target build settings. I tried deleting all the derived data. I tried Xcode 26.0.1 and 26.1 beta 2.
1
0
89
5d
Unable to provision target
I have added an in-app purchase function into my app, and have enabled in-app purchase profile in developer portal(it's on by default and is marked gray in developer portal, I don't know if that's how it supposed to look like). I have issued the agreements and tried signing the app both manually and automatically, but neither of that worked. App can be built successfully in simulator but does not show the simulation window, but cannot build on real device or archive. Errors: Missing com.apple.developer.in-app-purchase, com.apple.developer.in-app-purchase.non-consumable, and com.apple.developer.in-app-purchase.subscription entitlements. Automatic signing failed Xcode failed to provision this target.
1
0
41
6d
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
39
6d
Impossible to connect iPhone 7 (iOS 15.8) with xCode 26
I have spent nearly an hour trying to get my iPhone 7 with iOS 15.8 to be recognized within xCode 26. I did not have this issue with the previous version of xCode. I have tried rebooting my Mac, rebooting my iPhone 7, removing the iPhone 7 from the list of devices that belong to my account, verified that I have support files for iOS 15.8 installed, signing out of my Apple account and signing back in....nothing works. Every time I go to "Windows > Devices" I see the iPhone 7, but I get a never-ending spinning circle next to the iPhone 7 (which is shown as connected) along with a banner that says "xCode will continue when Joe's iPhone 7 is finished." I can leave the phone connected to my Mac for an hour, and this message and the spinning circle next to the iPhone 7 never changes.
2
0
89
6d
Issues updating to Xcode 26 -- can no longer successfully build project
I recently updated to macOS sequoia 15.6 Afterward, I updated to Xcode 26 The project I've been running for the last couple years no longer compiles on existing simulators and doesn't build to a physical device. I'm getting an error I'm not familiar with and have no idea how to directly resolve it: The specific error is 'Command SwiftGeneratePch failed with a nonzero exit code' Looking up this issue via Google, there wasn't really a lot of information on this particular build failure. Most suggestions were to change the location of the Derived Data folder (Xcode -> File -> Project Settings -> update location of derived data from default to relative) This was one of the only actionable solutions I found online but this doesn't fully address the issue for me, it just creates a new issue: "Command PhaseScriptExecution failed with a nonzero exit code" I feel like with enough digging around I should be able to find a solution to the "PhaseScriptExecution" issue; there seems to be a decent amount of information online about that particular problem. I would prefer if I could solve the original 'SwiftGeneratePch" failure without needing to address other issues, though. Is this possible?
3
2
219
6d
Resolving Framework Compatibility Across Different Xcode Versions
I have an early-stage framework project where the Xcode project directory is named HXiMateSDK. When I switched to a new Mac device, the framework compiled using the newly installed version of Xcode failed to compile in the old version of Xcode on the old machine. My clients might use my framework in different Xcode versions, so I need to resolve this issue. STEPS TO REPRODUCE The built product HXiMateSDK.framework from the new machine A, which was compiled using the latest Xcode version 26.0.1 (17A400). When creating a new project justTestNew on the new machine A using the latest Xcode version 26.0.1 (17A400), calling the method getSDKVersion from the HXiMateSDK.framework compiles successfully. When creating a new project justTestOldEnv on the old machine B using Xcode 13.2.1 (13C100), calling the method getSDKVersion from the HXiMateSDK.framework results in a compilation failure.
1
0
84
6d
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
57
6d
XCUITests not starting
Looking for a way to overcome this issue when starting UI tests that used to be working: Source was stale 337 times within the last 500 ms (12 (latestGeneration) != 22 (lastKnownShmemState)): CFPrefsPlistSource<0x600003004c60> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: ###/data, Contents Need Refresh: Yes) ... Failed to initialize for UI testing: Error Domain=XCTDaemonErrorDomain Code=18 "Timed out waiting for AX loaded notification" UserInfo={NSLocalizedDescription=Timed out waiting for AX loaded notification} Message from debugger: killed The environment is Xcode 16.3 with iOS Simulator 18.0. Not using the latest Simulator 18.4 because of another bug with network requests: https://developer.apple.com/forums/thread/777999
1
1
134
1w
PhotosUI does not build with UIKit and WidgetKit in XCode26
To reproduce this bug create a new Xcode Project for IOS choose UIKit. In the app delegate add the following lines. As you can see in the above image . Line 19 with the initialization of PHPickerViewController has no compilation failure. Now lets add import WidgetKit As soon as widgetKit is imported a compiler error is thrown which is PHPickerViewController is not in scope. This worked with Xcode 16.4 It was possible to have a swift file with both WidgetKit implementations and PhotosUI implementations. This behavior has changed in Xcode 26/26.0.1 . Does anybody know why this happens , could not find any clues within the different versions of documentations. P.S Found a work around which raises further questions Adding import SwiftUI fixes this problem , I am genuinely curious on how this is happening on a compiler level. LINKS To my previously published post :https://developer.apple.com/forums/thread/804059
0
3
72
1w