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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Error trying to publish .Net Maui app from VS2022
I just finished my first mobile app using .Net Maui. I have created all of the required certificatee, identifier, and profile in my Apple developer account and downloaded them to my MacAir. On my Windows machine I connect to my MacAir in VS2022 and build my release. Then I go to publish and I get this error: Cannot create an IOS archive 'AgentManagerMobile'. Process cannot be executed on XMA server. MessagingRemoteException: An error occurred on client Build1647067 while executing a reply for topic xvs/build/16.4.7067/execute-task/{AppName}/399e8ad002fWriteAppManifest ArgumentNullException: Value cannot be null. Parameter name: path2 What is parameter path2? Can anyone help with solving this? Thanks, Phill
1
1
784
Feb ’25
Not able to build an app after including framework/Static lib in the app
I have an app, which is depended on custom SDK. Custom SDK has dependencies, included all dependencies in Podspec and custom framework/static lib ios.vendored_frameworks. here I sample of my pod spec Pod::Spec.new do |s| s.name = "SDK" s.version = "1.0.1" s.summary = "SDK" s.source = { :git => "https://github.com/ABC/SDK.git", :tag => "v"+s.version.to_s } s.platform = :ios s.ios.deployment_target = '16.0' s.swift_version = '4.2' s.static_framework = true s.frameworks = 'Security' s.frameworks = 'CoreLocation' s.requires_arc = true s.module_name = 'SDK' s.library = 'z' s.default_subspec = 'Shared' s.subspec 'Shared' do |shared| shared.ios.vendored_frameworks = 'SDKLib.xcframework' shared.dependency 'CocoaAsyncSocket', '~> 7.4' shared.dependency 'CocoaHTTPServer' shared.dependency 'SocketRocket', '~> 0.6' shared.dependency 'QNNetDiag' shared.dependency 'SAMKeychain' shared.dependency 'AFNetworking/Reachability', '~> 4.0' shared.dependency 'AFNetworking/Serialization', '~> 4.0' shared.dependency 'AFNetworking/Security', '~> 4.0' shared.dependency 'AFNetworking/NSURLSession', '~> 4.0' shared.dependency 'CocoaMQTT' shared.dependency 'Starscream', '~> 4.0.8' shared.dependency 'TrustKit' shared.dependency 'Firebase/Analytics' end end below error I am getting while linking lib
1
0
368
Feb ’25
ERROR: Unrecognized attribute string flag '?' in attribute string "T@"NSString",?,R,C" for property debugDescription
Hello, I'm seeing many errors like this in the Xcode debug console when I build and run my app: ERROR: Unrecognized attribute string flag '?' in attribute string "T@"NSString",?,R,C" for property debugDescription The app project makes heavy use of Logger(), and I suspect it is related to that logging in some way, but I haven't been able to narrow down the issue to specific log calls. I have Category, Subsystem and Timestamp enabled in the Xcode console, but none of those are displayed for this output. What causes this? Or how can I better narrow down the source?
4
3
1k
Feb ’25
dyld: Symbol not found ... certain MeshResource APIs on iOS 17.x
I submitted feedback as FB16463501 -- posting here for others to see, or maybe for Apple to share any help if there are workarounds, etc.: Targets below iOS 18.x fail to launch app due to dyld[xxxxx]: Symbol not found: errors when referencing: MeshResource.init(from:) async - https://developer.apple.com/documentation/realitykit/meshresource/init(from:)-b7hb i.e. dyld[61511]: Symbol not found: _$s10RealityKit12MeshResourceC0A10FoundationE4fromACSayAD0C10DescriptorVG_tYaKcfC MeshResource.replace(with:) async - https://developer.apple.com/documentation/realitykit/meshresource/replace(with:)-8uvri i.e. dyld[78830]: Symbol not found: _$s10RealityKit12MeshResourceC0A10FoundationE7replace4withyAcDE8ContentsV_tYaKF Targets tested that exhibit issue: (DYLD errors) Device: iOS 17.7.2, iPhone 14 Pro Max Simulator: iOS 17.5 (21F79), iPhone 15 System Information: macOS Version 15.3 (Build 24D60) Xcode 16.2 (23507) (Build 16C5032a) MRE -- include this code in your app: (no need to invoke, just reference) static func addOrUpdateEntityModel_MRE(_ entity: ModelEntity) async { let descriptor = MeshDescriptor(name: "MyDescriptor") do { if let modelComponent = entity.model { // update existing ModelComponent if let model = try? MeshResource.Model(id: "MyModelId", descriptors: [descriptor]) { var contents = MeshResource.Contents() contents.models = .init([model]) try await modelComponent.mesh.replace(with: contents) /// `dyld[78830]: Symbol not found: _$s10RealityKit12MeshResourceC0A10FoundationE7replace4withyAcDE8ContentsV_tYaKF` } } else { //create new ModelComponent /// Comment-out the 2 lines below == dyld error for above `MeshResource.replace(with:)` let meshRes = try await MeshResource(from: [descriptor]) /// `dyld[61511]: Symbol not found: _$s10RealityKit12MeshResourceC0A10FoundationE4fromACSayAD0C10DescriptorVG_tYaKcfC` entity.model = .init(mesh: meshRes, materials: [SimpleMaterial()]) } } catch { fatalError() } }
0
0
517
Feb ’25
How to set Reality Composer Pro Entity/Anchor Transform/Position? iOS
I am at a loss. I have looked at examples, and I have used chat/cursor. I cannot figure out how to target the transform/position of a Reality Composer Pro project when adding it to an ARView in iOS. I have a test red sphere working perfectly for raycast positioning. When I pass the same variables (tested with print out) to the Entity or Anchor position/transform nothing changes. It seems that, no matter what, the content of the Reality Composer Pro project is placed where the camera view initialized. How do I actually interact with its position? I just want to be able to tap the screen and place the RCP wherever I want.
1
0
357
Feb ’25
Nullifying Sandbox Contraints for an .xcodeproj following Xcode's 'command-line' template?
Environment: Xcode v. 16.2; Swift version 6+ Scenario: I have an .xcodeproj within an .xcsworkingspace that must follow the 'command-line' paradigm outside the sandbox. My UnitTest (using the newer 'Swift Test' vs 'XCTest') is hitting runtime fatal errors due to sandbox violations. Here's a typical error line from the compiler: 1 duplicate report for Sandbox: chmod(41377) deny(1) file-read-data /Users/Ric/Library/.. I've set the .entitlement to ignore sandbox: <key>com.apple.security.app-sandbox</key> <false/> I also created a shell script in the project build phase to access my TestData which was copied via a Build Phase: #!/bin/bash BUILD_DIR="${BUILT_PRODUCTS_DIR}" TEST_DATA="${SRCROOT}/SwiftModelTest/TestData" mkdir -p "${BUILD_DIR}/TestData" cp -R "${TEST_DATA}/" "${BUILD_DIR}/TestData/" What do I need to allow real-time Testing of my code without worrying about the Sandbox?
1
0
477
Feb ’25
MacBook Air w Sequoia 15.3 failing to output in Debug Area with Swift
Hi Folks... I’m 81 and trying to learn Swift. I taught programming 40 years ago but haven’t coded for over 20 years. As you can see in the subject line, I’m running Sequoia 15.3 on a MacBook Air and learning and running code samples from “IOS 18 Programming for Beginners” by Ahmad Sahar. When I run the code samples, the variable settings show up in the Debug area but none of the output even though Sahar’s book states that it should. I’m wondering if I’m doing some stupid newbie thing or if it might be a bug? Anyone seen this one?
1
0
209
Feb ’25
App Installation Fails on XCODE 15.3 and up
I have two apps that I have been supporting for some time now. When Xcode 15.3 came out the app started crashing. No code changes whatsoever. I could not figure out why it would crash in 15.3. I just downloaded Xcode 15.2 and kept using 15.2. I have stayed recent with other apps, but I have just used 15.2 for this app. I just upgraded my OS to sequoia which also upgrades my Xcode to 16.2. To my surprise 15.2 is not supported on sequoia, so I only have 2 choices. setup a VM with an older OS and Xcode 15.2 or figure out why the app crashes on anything beyond 15.2 Like I said no problem running on Xcode 15.2 What gets shown in the error starts off with this: Unable to Install “Gatlinburg Pocket Guide” Domain: IXUserPresentableErrorDomain Code: 1 Failure Reason: Please try again later. Recovery Suggestion: Failed to load Info.plist from bundle at path .... Hoping someone has some suggestions for me or has seen this happen before. Thanks.
1
0
183
Feb ’25
Trouble with getting a background refresh task working
I am able to setup and schedule a background refresh task as well as manually trigger it via Xcode and the simulator tied to my iPhone 11 Pro test phone using the e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier: However, it won't execute on the app on it's own. And yes, the pinfo.list entries are correct and match! I know the scheduler is not exact on timing but it's just not executing on its own. Since I can trigger manually it I'm pretty sure the code is good but I must be missing something. I created an observable object for this code and the relevant parts look like this: class BackgroundTaskHandler: ObservableObject { static let shared = BackgroundTaskHandler() var taskState: BackgroundTaskState = .idle let backgroundAppRefreshTask = "com.opexnetworks.templateapp.shell.V1.appRefreshTask" func registerBackgroundTask() { BGTaskScheduler.shared.register(forTaskWithIdentifier: backgroundAppRefreshTask, using: nil) { task in self.handleAppRefresh(task: task as! BGAppRefreshTask) } self.updateTaskState(to: .idle, logMessage: "✅ Background app refresh task '\(backgroundAppRefreshTask)' registered.") BGTaskScheduler.shared.register(forTaskWithIdentifier: backgroundTaskIdentifier, using: nil) { task in self.handleProcessingTask(task: task as! BGProcessingTask) } self.updateTaskState(to: .idle, logMessage: "✅ Background task identifier '\(backgroundTaskIdentifier)' registered.") } // Handle the app refresh task private func handleAppRefresh(task: BGAppRefreshTask) { self.updateTaskState(to: .running, logMessage: "🔥 app refresh task is now running.") PostNotification.sendNotification(title: "Task Running", body: "App refresh task is now running.") let queue = OperationQueue() queue.maxConcurrentOperationCount = 1 let operation = BlockOperation { self.doSomeShortTaskWork() } task.expirationHandler = { self.updateTaskState(to: .expired, logMessage: "💀 App refresh task expired before completion.") PostNotification.sendNotification(title: "Task Expired", body: "App refresh task expired before completion \(self.formattedDate(Date())).") operation.cancel() } operation.completionBlock = { if !operation.isCancelled { self.taskState = .completed } task.setTaskCompleted(success: !operation.isCancelled) let completionDate = Date() UserDefaults.standard.set(completionDate, forKey: "LastBackgroundTaskCompletionDate") self.updateTaskState(to: .completed, logMessage: "🏁 App refresh task completed at \(self.formattedDate(completionDate)).") PostNotification.sendNotification(title: "Task Completed", body: "App refresh task completed at: \(completionDate)") self.scheduleAppRefresh() // Schedule the next one } queue.addOperation(operation) } func scheduleAppRefresh() { // Check for any pending task requests BGTaskScheduler.shared.getPendingTaskRequests { taskRequests in let refreshTaskIdentifier = self.backgroundAppRefreshTask let refreshTaskAlreadyScheduled = taskRequests.contains { $0.identifier == refreshTaskIdentifier } if refreshTaskAlreadyScheduled { self.updateTaskState(to: .pending, logMessage: "⚠️ App refresh task '\(refreshTaskIdentifier)' is already pending.") // Iterate over pending requests to get details for taskRequest in taskRequests where taskRequest.identifier == refreshTaskIdentifier { let earliestBeginDate: String if let date = taskRequest.earliestBeginDate { earliestBeginDate = self.formattedDate(date) } else { earliestBeginDate = "never" } self.updateTaskState(to: .pending, logMessage: "⚠️ Pending Task: \(taskRequest.identifier), Earliest Begin Date: \(earliestBeginDate)") } // Optionally, show a warning message to the user in your app PostNotification.sendNotification(title: "Pending Tasks", body: "App refresh task is already pending. Task scheduling cancelled.") return } else { // No pending app refresh task, so schedule a new one let request = BGAppRefreshTaskRequest(identifier: refreshTaskIdentifier) request.earliestBeginDate = Date(timeIntervalSinceNow: 15 * 60) // Earliest in 15 minutes do { try BGTaskScheduler.shared.submit(request) self.taskState = .scheduled self.updateTaskState(to: .scheduled, logMessage: "✅ App refresh task '\(refreshTaskIdentifier)' successfully scheduled for about 15 minutes later.") PostNotification.sendNotification(title: "Task Scheduled", body: "App refresh task has been scheduled to run in about 15 minutes.") } catch { print("Could not schedule app refresh: \(error)") self.taskState = .failed self.updateTaskState(to: .failed, logMessage: "❌ Failed to schedule app refresh task.") } } } } // Short task work simulation private func doSomeShortTaskWork() { print("Doing some short task work...") // Simulate a short background task (e.g., fetching new data from server) sleep(5) print("Short task work completed.") } In my AppDelegate I trigger the registerBackground task in the didFinishLaunchingWithOptions here: BackgroundTaskHandler.shared.registerBackgroundTask() And I scheduled it here in the launch view under a task when visible: .task { BackgroundTaskHandler.shared.scheduleAppRefresh() } I've also tried the last in the AppDelegate after registering. either way the task schedules but never executes.
4
0
1.3k
Feb ’25
Xcode 16 cant see our project Git repo in Repo Navigator
For a number of years we have managed our iOS projects using Sourcetree and command line Git or Visual Code. I wanted to use the XCode Source control for a more integrated development experience. However, depite the fact that the Git repo is in the root of the XCode project tree, XCode cannot see that repo in the Source Control panel. Source Control IS enabled in settings I tried to add the repo using. Integrate >> New Git Repository. but Xcode then says there is an existing repository and does nothing. How do I add the existing local repo into the Xcode environment or does it now need to be managed only externally because it was not created using Xcode ? Thanks
3
1
220
Feb ’25
Crashes on Xcode 16.2
Xcode 16.2 crashes when opening .swift or .xib files. ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: Xcode [54754] Path: /Applications/Xcode-16.2.0.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 16.2 (23507) Build Info: IDEApplication-23507000000000000~2 (16C5032a) Code Type: ARM-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2025-02-10 07:45:46.2320 +0900 OS Version: macOS 15.3 (24D60) Report Version: 12 Anonymous UUID: C4102718-BC60-1A08-FB0D-3B7AAB19D6D0 Sleep/Wake UUID: 2FE8B1FA-D2A5-4F55-9DF5-2178F3212F84 Time Awake Since Boot: 120000 seconds Time Since Wake: 33305 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: Xcode [54754] Application Specific Information: abort() called Application Specific Signatures: NSInvalidArgumentException Application Specific Backtrace 0: 0 CoreFoundation 0x00000001971f6e80 __exceptionPreprocess + 176 1 DVTFoundation 0x000000010643788c DVTFailureHintExceptionPreprocessor + 388 2 libobjc.A.dylib 0x0000000196cdecd8 objc_exception_throw + 88 3 CoreFoundation 0x00000001972ac1d8 -[NSObject(NSObject) __retain_OA] + 0 4 CoreFoundation 0x0000000197163830 ___forwarding___ + 1568 5 CoreFoundation 0x0000000197163150 _CF_forwarding_prep_0 + 96 6 AssetCatalogFoundation 0x000000011c04aa68 -[IBICAbstractCatalogItem(IBICManifestArchivistDelegate) manifestArchivist:applyPropertiesFromChildEntry:toChild:results:] + 1380 7 AssetCatalogFoundation 0x000000011c10b3c8 -[IBICBundleIconSet manifestArchivist:applyPropertiesFromChildEntry:toChild:results:] + 112 8 AssetCatalogFoundation 0x000000011c065e0c -[IBICAppIconSet manifestArchivist:applyPropertiesFromChildEntry:toChild:results:] + 240 9 AssetCatalogFoundation 0x000000011c048704 -[IBICManifestArchivist childFromChildEntry:results:] + 192 10 AssetCatalogFoundation 0x000000011c048890 __73-[IBICManifestArchivist childrenFromContentsJSONChildrenEntries:results:]_block_invoke + 152 11 AssetCatalogFoundation 0x000000011c122668 IBWithObjectBufferResultingInArray + 72 12 AssetCatalogFoundation 0x000000011c0487b4 -[IBICManifestArchivist childrenFromContentsJSONChildrenEntries:results:] + 128 13 AssetCatalogFoundation 0x000000011c0490ec -[IBICManifestArchivist replaceChildrenFromFileSystemSnapshot:results:] + 456 14 AssetCatalogFoundation 0x000000011c0548fc -[IBICSlottedAsset replaceChildrenFromFileSystemSnapshot:results:] + 116 15 AssetCatalogFoundation 0x000000011c04924c -[IBICManifestArchivist replaceChildrenFromFileSystemSnapshot:results:] + 808 16 AssetCatalogFoundation 0x000000011c042e54 -[IBICFolder replaceChildrenFromFileSystemSnapshot:results:] + 116 17 AssetCatalogFoundation 0x000000011c08c8e8 -[IBICAbstractCatalog replaceChildrenWithDiskContent:] + 140 18 AssetCatalogFoundation 0x000000011c0798f0 -[IBICCatalogSynchronizer replaceCatalogWithContentsOfPathWhileItIsKnowThatSyncOperationsAreNotInflightAndAreDisabled:] + 140 19 AssetCatalogFoundation 0x000000011c0796f0 -[IBICCatalogSynchronizer replaceCatalogWithContentsOfPath:] + 104 20 AssetCatalogFoundation 0x000000011c077380 +[IBICCatalogSynchronizer synchronizerTakingOwnershipForCatalog:atPath:] + 92 21 AssetCatalogFoundation 0x000000011c0773e8 +[IBICCatalogSynchronizer synchronizerForCatalogAtPath:] + 68 22 AssetCatalogKit 0x000000011a249b04 __69+[IBICCatalogMediaRepository retainedCatalogSynchronizerForFilePath:]_block_invoke + 52 23 AssetCatalogFoundation 0x000000011c0c2708 -[NSMutableDictionary(IBMutableDictionaryAdditions) ib_objectForKey:creatingIfNecessaryWithBlock:] + 100 24 AssetCatalogKit 0x000000011a249a60 +[IBICCatalogMediaRepository retainedCatalogSynchronizerForFilePath:] + 136 25 AssetCatalogKit 0x000000011a24b660 -[IBICCatalogMediaRepository _addSynchronizerForCatalogAtPath:] + 48 26 AssetCatalogKit 0x000000011a24b12c __104-[IBICCatalogMediaRepository fileReferenceObserverDidReportUpdatedAndAddedResourcesByPath:removedPaths:]_block_invoke + 544 27 AssetCatalogKit 0x000000011a24acd8 -[IBICCatalogMediaRepository notifyObserversAfterPossiblyMutatingWithBlock:] + 88 28 AssetCatalogKit 0x000000011a24aed8 -[IBICCatalogMediaRepository fileReferenceObserverDidReportUpdatedAndAddedResourcesByPath:removedPaths:] + 132 29 IDEKit 0x000000010a4f0e80 __54-[IDEContainerContentsMediaRepository _startObserving]_block_invoke + 596 30 IDEFoundation 0x000000010ea491c8 -[IDEContainerContentProductionCoordinator deliverPendingResults:] + 172 31 DVTFoundation 0x0000000106618994 __48-[DVTDelayedInvocation initWithTarget:selector:]_block_invoke + 24 32 DVTFoundation 0x0000000106619a2c -[DVTDelayedInvocation runBlock:] + 272 33 Foundation 0x00000001984026b4 __NSFirePerformWithOrder + 296 34 CoreFoundation 0x0000000197183be8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 35 CoreFoundation 0x0000000197183ad4 __CFRunLoopDoObservers + 552 36 CoreFoundation 0x0000000197183104 __CFRunLoopRun + 788 37 CoreFoundation 0x0000000197182734 CFRunLoopRunSpecific + 588 38 HIToolbox 0x00000001a26f1530 RunCurrentEventLoopInMode + 292 39 HIToolbox 0x00000001a26f7348 ReceiveNextEventCommon + 676 40 HIToolbox 0x00000001a26f7508 _BlockUntilNextEventMatchingListInModeWithFilter + 76 41 AppKit 0x000000019acfa848 _DPSNextEvent + 660 42 AppKit 0x000000019b660c24 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 43 AppKit 0x000000019aced874 -[NSApplication run] + 480 44 IDEKit 0x000000010a278f14 -[IDEApplication run] + 192 45 AppKit 0x000000019acc4068 NSApplicationMain + 888 46 dyld 0x0000000196d1c274 start + 2840
2
0
475
Feb ’25
WidgetKit keep crashing and widgets not displaying
So I have a MacOS application that was working just fine before Xcode 16. The Widgets are not working anymore. The main application and the widgets share a file in a common App Group. The widget app now get a permission error when accessing the file. Also, the Widget Kit simulator keeps crashing. I also try to start a new project in Xcode, add a target with a Widget extension with an App Intent and run it, and it also crashes. Sometimes, it doesn't crash but just display the error: "Failed to load widget. The operation couldn't be completed. (WidgetKit_Simulator.WidgetDocument.Error error 2.). Edited to attach WidgetKit error log widgetKitError.txt
8
3
1.7k
Feb ’25
UIInputViewController获取外部输入框的点击事件
通过UIInputViewController自定义的一个键盘,键盘内部有一个自定义的输入框UITextField。 需要实现的效果:外部输入框和键盘上自定义输入框可互相点击切换第一响应,从而控制输入的文字插入在哪个输入框。 遇到的问题:当点击了自定义输入框并设置了自定义输入框为第一响应之后,再次点击外部输入框时,无法获取到点击外部输入框的事件,从而无法取消内部输入框的第一响应事件。
4
1
166
Feb ’25