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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

loudKit Containers are not being created or connecting back do apple dev besides the default container
Every new container i create for cloudkit doesn't work and or connect back to my icloud dev account. Here are the errors: Communication with Apple failed. An iCloud Container with Identifier 'iCloud.icloud.com.plantclock.backup' is not available. Please enter a different string. Provisioning profile "iOS Team Provisioning Profile: CGL.CannaGrowLog" doesn't support the iCloud.icloud.com.plantclock.backup iCloud Container. Provisioning profile "iOS Team Provisioning Profile: CGL.CannaGrowLog" doesn't match the entitlements file's value for the com.apple.developer.icloud-container-identifiers entitlement. STEPS TO REPRODUCE Went into xcode > Project name > targets > icloud > containers > + sign and anytime i try to add it fails with the above issues. Also, going into apple dev website has no option to even see or add containers.
1
0
113
6d
Problem installing debugging on IOS 18 with Xcode 16
Project previously built and installed fine (Xcode 16). Upgrade to IOS 18 and now debug install 'Prepares' for ever (never finishes) on both my iPhone 11 Pro and my 12.9 iPad. Tried clearing buffers, derived data, restarting/rebooting. The projects are projects that I have tested and run for several years on many versions, not new to the Xcode world. Permissioning (i.e. Developer mode) enabled on all devices, tried various cables on all devices. Relinked all devices..but no success. Projects build and run fine on simulators, but just can't finish installing on the real hardware. Stunning frustrating and NO USEFULL error messages.
2
0
108
6d
Can't build with Xcode 14: "Doesn't match platform DriverKit"
I have an app that includes a DriverKit extension that up until now I've been building without issue using Xcode 13. It was time to regenerate my Developer ID Application certificate so I needed to rebuild the app. However, I'm now running macOS Ventura and Xcode 14.3.1, and cannot get it to build in this later version of Xcode for reasons that are totally inscrutable to me. I've tried using both the newly generated provisioning profiles I've manually created in the "Certificates, Identifiers & Profiles" developer page, and the (still valid) provisioning profiles I already had installed. The trouble is that, when I select a provisioning profile I made for the DriverKit extension, Xcode won't accept it for the following reason: Platform: macOS Doesn't match platform DriverKit This makes no sense to me! There is no way to create a distribution provisioning profile for the "DriverKit" platform. All I can select is either "Mac" or "Mac Catalyst". So there's seemingly no way out of this. What am I missing?
0
0
82
6d
tabview tabviewstyle sidebaradaptable in macos 15.1. beta 5 is non responsive
Whan using a tabview set with a tabviewstyle of sidebaradaptable on macOS 15.1 beta 5 the tabs are non responsive and is basically broken. Example code... If you click around on these tabs you will see it is not responsive. When you add a lot more tabs from a for loop for example you really get poor performance. But this is not the case with earlier beta releases. TabView {                 Tab("One", systemImage: "1.circle.fill") {                     Text("Test One")                 }                 Tab("Two", systemImage: "2.circle.fill") {                     Text("Test Two")                 }                 Tab("Three", systemImage: "3.circle.fill") {                     Text("Test Three")                 }             }             .tabViewStyle(.sidebarAdaptable)
2
0
95
6d
Not able to inspect react native drop down element in iOS
Am trying to automate below drop down but iOS Accessibility inspector is unable to detect the element. Even we tried with Appium Inspector issue is same. Drop down: https://www.npmjs.com/package/react-native-element-dropdown We tried to debug the dropdown component. In that we can see the value is rendered properly from react. We have raised the issue with Appium, but they have given few suggestions in the Appium setting but it didn't solve. Now it's something that has to be done from XCTest Framework end. Appium issue git link: https://github.com/appium/appium/issues/14825
0
0
51
6d
Unable to build Core Image kernels in XCode 16
My app is suddenly broken when I build it with XCode 16. It seems Core Image kernels compilation is broken in XCode 16. Answers on StackOverflow seem to suggest we need to use a downgraded version of Core Image framework as a workaround, but I am not sure if there is a better solution out there. FYI, I am using [[ stitchable ]] kernels and I see projects having stitchable are the ones showing issue. air-lld: error: symbol(s) not found for target 'air64_v26-apple-ios17.0.0' metal: error: air-lld command failed with exit code 1 (use -v to see invocation) Showing Recent Messages /Users/Username/Camera4S-Swift/air-lld:1:1: ignoring file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreImage.framework/CoreImage.metallib', file AIR version (2.7) is bigger than the one of the target being linked (2.6)
0
1
83
6d
KeyedUnarchive a previously object archived with NSArchiver archivedDataWithRootObject
Hi, in my previous macOS app I used to archive a dictionary to a preference file using [NSArchiver archivedDataWithRootObject:dictionary]; and to unarchive it using [NSUnarchiver unarchiveObjectWithData:dataFromDisk]; Now I would like to replace the 2 deprecated methods with NSError *error; NSSet *classSet = [NSSet setWithObjects:[NSDictionary class], [NSArray class], [NSString class], [NSNumber class], [NSData class], nil]; NSDictionary *dictionary = [NSKeyedUnarchiver unarchivedObjectOfClasses:classSet fromData:dataFromDisk error:&error]; But I get a nil dictionary and the error 4864: non-keyed archive cannot be decoded by NSKeyedUnarchiver. So I guess I should first keep on unarchiving the preferences dataFromDisk using the old deprecated method [NSUnarchiver unarchiveObjectWithData:dataFromDisk]; Then I could use the new NSKeyedArchiver and NSKeyedUnarchiver methods for the upcoming release. But, if this deprecated method [NSUnarchiver unarchiveObjectWithData:dataFromDisk]; fails to unarchive the old data (and on some machines now it fails), how could I use the new methods? Should I consider my old preference file gone? Is a way to force the new NSKeyedUnarchiver method to unarchive data previously archived with NSArchiver ?
0
0
28
6d
Swift Package Manager (SPM) can't load recently used dependencies or find new one since upgrade to Xcode16
Since upgrading to Xcode 16 Swift Package Manager seems to be broken. It can't load recently used packages (just spins the progress indicator). Same thing when trying to search for a new package. I've looked online and can't find anything useful. I've deleted all the caches. Resetting existing packages completes successfully. Anyone else seen this before and have any suggestions? Thanks
3
4
161
6d
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.
3
0
115
1w
FCP Workflow extension does not build with clang unknown argument -e_ProExtensionMain in Xcode 16
With Xcode 16 I cant make the Final Cut Extension Workflow work. I am quite sure I was able to add the Workflow Extension target a couple of months ago in Xcode 15 and did successfully build it, but in Xcode 16 it wont build and it fails with this error: clang: error: unknown argument: '-e_ProExtensionMain' I have installed multiple times Workflow Extensions SDK 1.0.2 and even disabled Library validation like its described in the release notes but I dont think thats the problem here. Seems like clang doesn't have the arguments for it, I guess the SDK should add these but seems like something got messed up - the template shows up fine in Xcode. I reinstalled Xcode and command line tools but that didnt help. Checking clang it really doesnt have the argument. But where does the SDK add this? Xcode seems to be using internal clang and /usr/bin/clang doesn't have it either. Any tips what could be the problem here? I was not really able to locate the SDK to remove it before trying to install again - any ideas? Steps to reproduce Create new project Add FCP workflow extension target Build -> it fails Same behaviour with 16.1 Beta. I am running Sonoma 14.7. Thanks in advance for any ideas!
3
0
126
1w
Pls validate workaround for Predictive Code n/a on external boots
What minimal changes can I make to use Xcode 16+ predictive code completion (PCC) when I've been booting from external drives (on the same apple-silicon machine)? PCC says it requires booting from an internal drive. I boot from external for a host of reasons that aren't going to change, but need to investigate whether/how I should accommodate PCC. I haven't found technical communications on PCC requirements, and I hate to guess (wrong) because OS/workflow reconfiguration is hard and disruptive. So this post is to ask whether my approach would work, or if there's a better one. I hope to continue using the external for the user home directory, the installed Xcode application, and Xcode temporary files (and of course the projects and artifacts). (a) Does the "internal drive" requirement extend only to booting, or also to installing Xcode or situating the user HOME dir? (b) Can one use the same external HOME directory for a user booting alternately from an internal and external drives? I would doubt it since the OS's would conflict e.g., in the HOME/Library state. So I assume that means we use separate HOME dir's, but link key user HOME directories to external/real HOME (git, etc. - also .ssh?). Then OS's have distinct views, but user has mostly common view. (Assuming user always codes/builds for least-common-denominator.) Aside: is it possible to redirect the system var/temp to an external? (c) Xcode signing for the same machine/CPU seems locked to a specific OS. I.e., to switch between OS drives but do code signing in Xcode, I've had to re-issue a certificate. (c-1) Is that avoidable? (c-2) Can I somehow maintain a per-machine certificate, and toggle between them? (c-3) Is that process made possible or impossible if Xcode is always pointing at the same Derived-Data/Archives directories? Is there any way to make it semi-automatic, once configured? Thank you! (I didn't see any forum tag for PCC.)
2
0
111
1w
How to add a new target using Xcode16 and cocoapods
On my Mac I have MacOs15 and Xcode 16 installed. I'm working with cocoapods, when adding a new target to my App, pod update it fails. What can I do to solve the problem. hunter-movil-main % npx cap update ios ✔ Updating iOS plugins in 23.10ms [info] Found 6 Capacitor plugins for ios: -capacitor-community/fcm-3.0.2 -capacitor/app-4.1.1 -capacitor/haptics-4.1.0 -capacitor/keyboard-4.1.1 -capacitor/push-notifications-4.1.2 -capacitor/status-bar-4.1.1 ✖ Updating iOS native dependencies with pod install - failed! ✖ update ios - failed! [error] Analyzing dependencies Searching for inspections failed: undefined method `map' for nil ### Command /opt/homebrew/Cellar/cocoapods/1.15.2_1/libexec/bin/pod install ### Report * What did you do? * What did you expect to happen? * What happened instead? ### Stack CocoaPods : 1.15.2 Ruby : ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [arm64-darwin24] RubyGems : 3.5.18 Host : macOS 15.0 (24A335) Xcode : 16.0 (16A242d) Git : git version 2.39.5 (Apple Git-154) Ruby lib dir : /opt/homebrew/Cellar/ruby/3.3.5/lib Repositories : trunk - CDN - https://cdn.cocoapods.org/ ### Plugins cocoapods-deintegrate : 1.0.5 cocoapods-plugins : 1.0.0 cocoapods-search : 1.0.1 cocoapods-trunk : 1.6.0 cocoapods-try : 1.2.0 ### Podfile ruby require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers' platform :ios, '13.0' use_frameworks! # workaround to avoid Xcode caching of Pods that requires # Product -> Clean Build Folder after new Cordova plugins installed # Requires CocoaPods 1.6 or newer install! 'cocoapods', :disable_input_output_paths => true def capacitor_pods pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' pod 'CapacitorCommunityFcm', :path => '../../node_modules/@capacitor-community/fcm' pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app' pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics' pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard' pod 'CapacitorPushNotifications', :path => '../../node_modules/@capacitor/push-notifications' pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar' end target 'App' do capacitor_pods # Add your Pods here pod 'Firebase/Messaging' end post_install do |installer| assertDeploymentTarget(installer) end ### Error RuntimeError - `PBXGroup` attempted to initialize an object with unknown ISA `PBXFileSystemSynchronizedRootGroup` from attributes: `{"isa"=>"PBXFileSystemSynchronizedRootGroup", "exceptions"=>["743C7E622CA48F72000F87A0"], "explicitFileTypes"=>{}, "explicitFolders"=>[], "path"=>"pushextension", "sourceTree"=>"<group>"}`
2
0
301
1w
How to refresh local Swift Package after adding files in Xcode 16?
Since upgrading to Xcode 16, I've noticed that when I add new files to my local Swift packages, the "Update Package" option is no longer available when I right-click on my local package. In previous versions of Xcode, I used this feature to make Xcode recognize newly added files without any issues. Now, with Xcode 16, the only way I've found to get Xcode to recognize new files is to remove and re-add the entire package, which is obviously not ideal. I've tried cleaning the build folder and rebuilding the project, but it doesn't seem to help. Is there a new workflow or method in Xcode 16 to refresh or update local Swift packages without needing to remove and re-add them every time? Any suggestions or workarounds would be greatly appreciated! What I’ve tried so far: Cleaning and rebuilding the project Looking for any options under "File > Packages" menu Environment: Xcode 16 Local Swift Package Thanks in advance!
2
1
124
1w
xcodebuild hangs for some users, not all
Mac OS: 12.3.1 Monterey (Mac Mini 202 Xcode: 13.4.1 'xcodebuild -version' hangs indefinitely for most users, except for one local admin account and one non-admin account (LDAP user). I've searched high and low and found some related issues on this forum and elsewhere, most of which indicate that the Xcode license has not been accepted and provide instructions to accept it from the command line. All of these have been tried countless times, plus Xcode 13.4.1 and CommandLineTools have been reinstalled, and still the issue remains: Only one non-admin user (myself) and the local admin user can run 'xcodebuild' from the command line without hanging. The same is true from Mac Terminal application in a remote console (VNC) session, or putty/xterm connected remotely via ssh. We can't upgrade Mac OS or Xcode as this is a build/test machine in a server farm and the specific OS and Xcode versions are required minimums for customer support purposes. Doesn't seem that there is setting unique to each user that could enable/disable Xcode, but the inner workings of Mac OS and Xcode remain largely a mystery. Please help!
3
0
105
1w
Xcode 16 Overheating issue on an M1 Pro
I’m using Xcode 16 on an M1 Pro and experiencing overheating issues. It seems like Apple rushed the release without addressing glitches that cause the laptop to overheat, which can directly affect battery life, decreasing its performance and, in turn, lowering the value of the Mac. I really dislike this from Apple. We pay a lot for their products, and issues like these devalue them.
0
0
113
1w