Build, test, and submit your app using Xcode, Apple's integrated development environment.

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

FamilyControls Framework info.plist missing
We are trying to create a screentime app using the Family Controls as well as Device activity frameworks. The build succeeds but while pushing to an iphone we are getting an info.plist file for deviceactivity.framework could not be found error. For reference when using the Screentime API a physical device must be used not a simulator. When we remove the device activity framework this error also occurs for the family controls framework. We have added the Family Controls(development) Capability and applied for the distribution capability. We have redownloaded xcode multiple times on the main device, deleted derived data, and redownloaded all of the iphone SDKs and the issue still persists.
0
0
238
Mar ’25
Why can't Xcode find symbols in scope, but still compiles?
My swiftUI project has started to constantly display "Cannot find 'symbol' in scope" errors in code i haven't touched, and the project still compiles fine. Neither cleaning build folder or compiling fix the errors, but if I right click the symbol, select "jump to definition" it will find it without problem and then when I return to the original file the error will be cleared. What can I do to stop these from happening?
0
1
186
Feb ’25
Unable to Install Provisioning profile
Hi, I'm unable to install provisioning profile on my iPad and I know the xcode component iOS/iPadOs version and iPadOS version should be same or below the latest compared to xcode components. Now the issue is xcode component version is iOS 18.4 (22E235) SDK + iOS 18.4 (22E238) Simulator (Installed) and iPadOS version is iOS 18.4.1(22E252) could this be cause of issue ? If yes then when will apple release components for 18.4.1? Because iOS 18.4.1 release at least 3-4 weeks before this post.
0
0
96
May ’25
Bonjour Capabilities
I'm a noobie but doing a tutorial where it requires me to add these capabilities to my project. Access Wi-Fi Information Network Extentions Bonjour Services I have the Access Wi-Fi and Network Extentions installed but I could not find Bonjour Services Any help would be much appreciated! Thanks
0
0
151
Jan ’25
launchd_sim and AppleSpell deadlock
I've got a 2019 Intel iMac running Sequoia 15.4.1 and Xcode 16.3. Every time I try to view a storyboard Xcode locks up and beachballs on me. It takes minutes to load the file. When I force-quit Xcode, the report that shows up has this as the reason: Processes reached dispatch thread soft limit (64): launchd_sim [96305] [unique pid 194673], launchd_sim [96260] [unique pid 194628] Deadlock: AppleSpell [1494] thread 0x1df0c4 DispatchQueue 313 -> AppleSpell [1494] thread 0x1df0c4 DispatchQueue 313 Deadlock: AppleSpell [1494] thread 0x1df114 DispatchQueue 86 -> AppleSpell [1494] thread 0x1df114 DispatchQueue 86 Blocked by Deadlock: 1 task - AppleSpell [1494] I'm wondering, why is AppleSpell trying to spell-check a plist file? Is there any way to tell AppleSpell to ignore a file?
0
0
71
Apr ’25
WKWebView
I am using Xcode 15.2. I am loading a URL in a WKWebView, but a hand cursor appears above the web view. Scrolling up and down does not work. I tried adjusting the scroll bounds and isUserInteractionEnabled, but the hand cursor is still visible. How can I fix this?
0
0
133
Feb ’25
Xcode completion binding not working in 16.2
I'm wondering why 'Select Previous Completion' and 'Select Next Completion' aren't working. I'm using Ctrl-K and Ctrl-J but only my arrow keys work to navigation the completion list. 'Show Completion List' works just fine with Ctrl-Esc. There are no conflicts with any Xcode bindings, and I've checked my system settings for keyboard shortcuts as well.. I've completely disabled copilot, etc.. Is there another setting I'm missing? Or, is this a known issue?
0
0
31
Apr ’25
Swift, kevent, and wth?!?!?
I have this code: var eventIn = kevent(ident: UInt(self.socket), filter: Int16(EVFILT_WRITE), flags: UInt16((EV_ADD | EV_ENABLE)), fflags: 0, data: 0, udata: nil ) I looked at it and thought why do I have those extra parentheses? So I changed it to var eventIn = kevent(ident: UInt(self.socket), filter: Int16(EVFILT_WRITE), flags: UInt16(EV_ADD | EV_ENABLE), // changed line! fflags: 0, data: 0, udata: nil ) and then kevent gave me EBADF. Does this make sense to anyone?
0
0
235
Feb ’25
Weather Authentication Failed
I'm pretty new on this platform and also developing IOS mobile apps. I've been struggling for using the data of the api weather kit apple. I have an acount of apple developer, downloaded the certificate... i follow all the necessaries steps in the portal and also in my project and i keep having this error message when i try to use it. I don't know what else should i do for having working it. I would absolutely appreciate that someone could help me with this. Thank you very much!!!!! Encountered an error when fetching weather data subset; location=<+41.38268070,+2.17702390> +/- 0.00m (speed -1.00 mps / course -1.00) @ 2/3/25, 22:54:03 Central European Standard Time, error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
0
1
228
Mar ’25
Most useless Xcode error message ever
Neither a google search, nor a search of the Apple forums give me a clue as to how to locate or fix the following message I get from Xcode. CLIENT: Failure to determine if this machine is in the process of shutting down, err=1/Operation not permitted This error message came from attempting to build and execute an iOS App which ran just fine the last time I built it. Now, that was actually a little over two years ago. This is an iOS app, which I've run successfully for more than a year on macOS, and that, "My Mac (Designed for iPad)", is what my build target for this run was. Any ideas? Anyone? If this is a "known condition", just why doesn't a friendly internet search or a search of the Apple forums NOT tell me what it means, or what causes the message. Of course, I've upgraded the OS a few times, and updated Xcode as well, but have just not had any time to monkey around with my pet code project. Now that I've gotten some time, and I want to see what's new since March of '23, I finally remember where I stashed my code repository and decided to take it for a spin. Sure, I expect(ed) to see Xcode tell me that the version of Swift has been updated, and maybe some code constructs need to be fixed. But, NO, the code compiles fine. The first build attempt told me that I needed to update my provisioning profiles, and sign-in and agree to the updated developer agreements, which I did. Not so unhelpful was the code window in the debugger: libswiftCore.dylib`swift_willThrow: -> 0x1aeb7b2a0 <+0>: pacibsp 0x1aeb7b2a4 <+4>: str x19, [sp, #-0x20]! 0x1aeb7b2a8 <+8>: stp x29, x30, [sp, #0x10] 0x1aeb7b2ac <+12>: add x29, sp, #0x10 0x1aeb7b2b0 <+16>: adrp x8, 365651 0x1aeb7b2b4 <+20>: add x8, x8, #0x88 ; _swift_willThrow 0x1aeb7b2b8 <+24>: ldapr x8, [x8] 0x1aeb7b2bc <+28>: cbnz x8, 0x1aeb7b2cc ; <+44> 0x1aeb7b2c0 <+32>: ldp x29, x30, [sp, #0x10] 0x1aeb7b2c4 <+36>: ldr x19, [sp], #0x20 0x1aeb7b2c8 <+40>: retab 0x1aeb7b2cc <+44>: mov x0, x21 0x1aeb7b2d0 <+48>: mov x19, x21 0x1aeb7b2d4 <+52>: blraaz x8 0x1aeb7b2d8 <+56>: mov x21, x19 0x1aeb7b2dc <+60>: b 0x1aeb7b2c0 ; <+32> Still not much to go on. I decide to see if it was a macOS vs. iOS issue, so did a clean build folder and tried running on an iPad simulator, "iPad (10th generation)". Now, I have a blank white screen on my simulator and not much to go on in the code window. import SwiftUI @main struct JottoApp: App { Thread1: Breakpoint 1.1 var body: some Scene { WindowGroup { ContentView() } } init() { UITableView.appearance().backgroundColor = UIColor.clear } } Any and all help with this error message will be appreciated.
0
0
93
Apr ’25
Error When Trying to Switch from ADEP to AdHoc for iOS App Deployment
I have created two different apps using ADEP, and they were working on iPad with iOS 14.6 and 14.7.1. The environments are as follows: Environment: 1.Mac mini (Mac OS X 10.7.5) Xcode 8.3.2 2.iMac (OS X El Capitan 10.11.6) Xcode 7.3 The certificates were exported from the environment in 1 and imported into 2. When I tried to switch from ADEP to AdHoc for app creation, I encountered an error. Specifically, the app worked fine on an iPad running iOS 12.5.7 in environment 1, but on devices with iOS 14.6, 14.7.1, and 17.7, the installation was successful, but when I tried to open the app, the following error message appeared: “XXXXX” needs to be updated To run this app on this version of iOS, the developer needs to update the app. Additionally, in environment 2, I’m unable to archive the app. Is it possible to create a working app by simply switching from ADEP to AdHoc without making any other changes to the environment?
0
0
122
Feb ’25
Breakpoint on Runtime Issue os_log_fault_default_callback
The app stops on the breakpoint when "All Runtime Issues" is added. If I disable the breakpoint, the app runs normally. Is there a new project setting to avoid this breakpoint from being set. It does not appear to be a valid error. I am running Xcode 16.2. I edited the "Type" field in the breakpoint box. This occurs with the "System Frameworks" option only.
0
2
100
Apr ’25
No drop in NSView
Since dragImage: is deprecated I am trying to update drag and drop with beginDraggingSessionWithItems:. Drag work fine but I cannot get drop to work correctly. In the code below change #ifndef to #ifdef (using dragImage:) make drop work as expected. draggingEntered, draggingUpdated, draggingExited, draggingEnded are all called but NOT performDragOperation (which do the drop). Uncommenting the line [pb_item pasteboard:paste_board provideDataForType:@"LN_PboardType"]; cause an exceptionPreprocess: -[NSPasteboardItem pasteboard:provideDataForType:]: unrecognized selector sent to instance 0x600001e64240. I also try add NSDraggingDestination, NSItemProviderWriting, NSPasteboardTypeOwner to @interface line without success. What I am doing wrong ? Any other method to do Drag and Drop (other than dragImage: and beginDraggingSessionWithItems:) ? Where can I found an Obj-C project using beginDraggingSessionWithItems: for drag an drop ? ``@interface Enclosure : NSView <NSDraggingSource, NSPasteboardItemDataProvider> - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { [super setAutoresizesSubviews:YES]; [self registerForDraggedTypes:[NSArray arrayWithObjects:@"LN_PboardType", NSPasteboardTypeString, nil]]; } return self; } - (BOOL)acceptsFirstMouse:(NSEvent *)event { return YES; } - (void)mouseDown:(NSEvent *)drag_event { NSImage *drag_image; NSPoint drag_position; NSRect dragging_rect; NSPasteboard *paste_board; NSDraggingItem *drag_item; NSArray *items_array; NSPasteboardItem *pb_item; paste_board = [NSPasteboard pasteboardWithName:@"LN_PboardType"]; [paste_board declareTypes:[NSArray arrayWithObjects:@"LN_PboardType", NSPasteboardTypeString, nil] owner:self]; pb_item = [[NSPasteboardItem alloc] init]; [pb_item setDataProvider:self forTypes:[NSArray arrayWithObjects:@"LN_PboardType", NSPasteboardTypeString, nil]]; // [pb_item pasteboard:paste_board provideDataForType:@"LN_PboardType"]; drag_image = [ [NSImage imageNamed:@"drag.jpg"]; drag_position = [self convertPoint:[drag_event locationInWindow] fromView:nil]; drag_position.x -= drag_image.size.width/2; drag_position.y -= drag_image.size.height/2; #ifndef DEPRECATED [self dragImage:drag_image at:drag_position offset:NSZeroSize event:drag_event pasteboard:paste_board source:self slideBack:YES]; #else drag_item = [[NSDraggingItem alloc] initWithPasteboardWriter:pb_item]; dragging_rect = NSMakeRect(drag_position.x, drag_position.y, drag_image.size.width, drag_image.size.height); [drag_item setDraggingFrame:dragging_rect contents:drag_image]; items_array = [NSArray arrayWithObject:drag_item]; [self beginDraggingSessionWithItems:items_array event:drag_event source:(id)self]; #endif } - (NSDragOperation)draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context { if (disable_drag_and_drop) return NSDragOperationNone; switch (context) { case NSDraggingContextWithinApplication: return NSDragOperationCopy; case NSDraggingContextOutsideApplication: return NSDragOperationMove; } return NSDragOperationNone; } …``
0
0
214
Feb ’25
Issue with Module Import and Archiving a Mixed Swift/C Library Using Swift Package Manager
Hello everyone, I’m encountering an issue when trying to build and archive my library BleeckerCodesLib using Swift Package Manager. My project is structured with two targets: CBleeckerLib: A C target that contains my image processing code (C source files and public headers). BleeckerCodesLib: A Swift target that depends on CBleeckerLib and performs an import CBleeckerLib. Below is the relevant portion of my Package.swift: // swift-tools-version:5.7 import PackageDescription let package = Package( name: "BleeckerCodesLib", platforms: [.iOS(.v16)], products: [ .library(name: "BleeckerCodesLib", targets: ["BleeckerCodesLib"]) ], targets: [ .target( name: "CBleeckerLib", publicHeadersPath: "include" ), .target( name: "BleeckerCodesLib", dependencies: ["CBleeckerLib"] ) ] ) Directory Structure My project directory looks like this: BleeckerCodesLib/ ├── BleeckerCodesLib.xcodeproj/ │ └── xcuserdata/ │ └── robertopitarch.xcuserdatad/ │ └── xcschemes/ │ └── xcschememanagement.plist ├── BleeckerCodesLib.h ├── Package.swift └── Sources/ ├── CBleeckerLib/ │ ├── bleecker-lib.c │ └── include/ │ ├── bleecker-lib.h │ └── CBleeckerLib.h └── BleeckerCodesLib/ ├── UIImage+Extensions.swift ├── ImageProcessingUtility.swift ├── APIManager.swift ├── BleeckerCodesLib.swift ├── CameraView.swift ├── RealTimeCameraView.swift └── BleeckerCameraWrapper.swift Code Example In my Swift code (for example, in BleeckerCodesLib.swift), I import the C module as follows: import SwiftUI import UIKit import CBleeckerLib // Import the C module public struct BleeckerCodes { public struct DetectedCode { public let code: String public let corners: [CGPoint] public init(code: String, corners: [CGPoint]) { self.code = code self.corners = corners } } // Initialization function public static func initializeLibrary() -> String { bleecker_init() // Call the C module function return "BleeckerCodesLibrary initialized!" } // ... other functions } The Problem When I try to compile or archive the project using commands such as: xcodebuild archive -project BleeckerCodesLib.xcodeproj -scheme BleeckerCodesLib -destination "generic/platform=iOS" -archivePath "archives/BleeckerCodesLib" I receive the error: "no such module 'CBleeckerLib'" Any assistance or step-by-step guidance on resolving this integration issue would be greatly appreciated. Thank you in advance!
0
0
246
Feb ’25