After upgrading to xcode 16.2 I see the following crash when resolving dependencies via command line:
** INTERNAL ERROR: Unable to load workspace '....' **
Uncaught Exception: *** -[NSMutableArray insertObjects:atIndexes:]: count of array (15) differs from count of index set (14)
Stack:
0 __exceptionPreprocess (in CoreFoundation)
1 objc_exception_throw (in libobjc.A.dylib)
2 -[__NSCFString characterAtIndex:].cold.1 (in CoreFoundation)
3 -[NSMutableArray insertObjects:atIndexes:] (in CoreFoundation)
4 __50-[IDEGroup insertGroupSubitems:atIndexes:context:]_block_invoke (in IDEFoundation)
5 -[DVTModelObjectGraph performBlockCoalescingModelChanges:] (in DVTFoundation)
6 -[IDEGroup insertGroupSubitems:atIndexes:context:] (in IDEFoundation)
7 -[NSMutableArray(DVTFoundationClassAdditions) dvt_sortedInsertOfObjects:withComparator:] (in DVTFoundation)
8 specialized IDESPMWorkspaceDelegate.registerDependencyFileReferences(_:modelGraphSynchronizerToken:) (in IDESwiftPackageCore)
9 specialized IDESPMWorkspaceDelegate.dependencyPackagesDidUpdate(packages:graphHasErrors:revalidatedFilePathCaches:modelGraphSynchronizerToken:) (in IDESwiftPackageCore)
10 closure #1 in IDESPMWorkspaceDelegate.packageGraphDidFinishAction(_:duration:result:) (in IDESwiftPackageCore)
11 partial apply for closure #1 in IDESPMWorkspaceDelegate.disableWorkspaceContentSynchronization(during:) (in IDESwiftPackageCore)
12 closure #1 in DVTModelObjectGraph.performBlockCoalescingModelChanges<A>(_:) (in DVTFoundation)
13 thunk for @callee_guaranteed () -> (@owned [String : NSObject]) (in DVTFoundation)
14 thunk for @escaping @callee_guaranteed () -> () (in DVTFoundation)
15 __58-[DVTModelObjectGraph performBlockCoalescingModelChanges:]_block_invoke (in DVTFoundation)
16 -[DVTModelGraphTransactionScope performTransaction:] (in DVTFoundation)
17 -[DVTModelObjectGraph performBlockCoalescingModelChanges:] (in DVTFoundation)
18 DVTModelObjectGraph.performBlockCoalescingModelChanges<A>(_:) (in DVTFoundation)
19 IDESPMWorkspaceDelegate.disableWorkspaceContentSynchronization(during:) (in IDESwiftPackageCore)
20 IDESPMWorkspaceDelegate.packageGraphDidFinishAction(_:duration:result:) (in IDESwiftPackageCore)
21 partial apply for thunk for @escaping @isolated(any) @callee_guaranteed @async () -> () (in IDESwiftPackageCore)
22 SPMWorkspace.packageGraphActionFinished(_:) (in SwiftPM)
23 closure #2 in closure #3 in SPMWorkspace.processPackageGraphActionsInBackgroundIfNeeded(canProcessPackageGraphActions:) (in SwiftPM)
24 dispatch thunk of SPMWorkspaceOrchestrationDelegate.packageGraphDidFinishAction(_:duration:result:) (in SwiftPM)
25 specialized thunk for @escaping @isolated(any) @callee_guaranteed @async () -> (@out A) (in SwiftPM)
26 partial apply for specialized thunk for @escaping @isolated(any) @callee_guaranteed @async () -> (@out A) (in SwiftPM)
27 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) (in libswift_Concurrency.dylib)
sh: line 1: 24112 Abort trap: 6 env NSUnbufferedIO=YES xcodebuild -scheme ***-Package -destination 'platform=iOS Simulator,id=950768B8-85B4-4250-A7EC-5AE8758369EE' -derivedDataPath .DerivedData -resultBundlePath '/.../***-Package.xcresult' -enableCodeCoverage YES -skipPackagePluginValidation -skipMacroValidation -disablePackageRepositoryCache build test```
Are there any workaround for this?
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Post
Replies
Boosts
Views
Activity
Hello everyone,
I am using Xcode 16 on macOS 14.6 and have integrated GitHub Copilot for Xcode. However, GitHub Copilot stops functioning when Netskope is enabled on my Mac. I have the necessary SSL certificate in my Mac’s Keychain and have trusted it. When I check, GitHub Copilot successfully connects to the server. However, I can’t find an option to set the certificate in Xcode. Since Netskope is required by my organization, I cannot disable it.
Has anyone encountered this issue or know how to resolve it?
Thank you in advance for your help!
Not a question, but a surprise.
Did I miss something, but apparently there has been no new beta release (16.3) since Release of 16.2 on Dec 11. 2 months without betas is really unusual (in fact, it never happened and usually, next beta n+1 is even released before the final release of version n).
So does that mean 16.3 will be a major update ? Wait and see.
Hi!
I have now spend a few days of trying to only get the option in Xcode to distribute to App Store. My app works on my own device, I have paid developer account and created a record for the app and its bundle id in App Store Connect. After archive the only options I can see is "Release testing, Enterprise, Debug and Custom". I have verified a lot of settings in both info.plist and build settings, without luck. I also see that the "Validate" button is greyed out, and the "SKIP_INSTALL" does not do the trick to enable it, and the archive is not a generic one, its explicit for watchOS. Using Xcode 16.2. Any suggestions of what to try before registering a support case.
NSTimer keeps a strong reference of a ViewController, but in Xcode Memory graph debugger it shows it as a weak reference ( i.e by a non-darker line ).
is this expected or a bug?
Context :
I was fixing a memory leak issue, where the Timer
inside the View controller was Not invalidated properly ( In turn Not allowing my view controller to get deallocated, even after being dismissed ).
So, when I invalidated the timer, View controller also got properly deallocated.
which means Timer was indeed keeping a strong reference!
Then why is it showing as a weak reference in the Xcode Debug Memory graph?
Latest version of Xcode 16.1.
I have an existing package dependency which is sitting on a git@ssh.dev.azure.com account.
So, now whenever I remove that package dependency, I can no longer add it within the Xcode UI. Just no possible way to add it or find it in the Search or Enter Package URL text field.
How on earth are we meant to add SSH packages now?
Anyone else have this issue? If so, have you found a work-around without having to manually edit the package dependencies in the project?
Hi,
Lately, I've been getting the same window each time I install an app for testing. Anyone else?
Hi all,
I'm facing the issue that cannot build app in Xcode 16
Command PhaseScriptExecution failed with a nonzero exit code
Please help to fix the issue, there is any reference how to resolve the error.
I keep having to delete keys in com.apple.dt.Xcode.plist in order to paste in an URL to a package without having to deal with and endless spinner. Then, after I do that to bring in a package that has a macro, it's a crap shoot that it will recognize the macro when I try to import it.
What's the deal?
We have developed a custom iOS framework called PaySDK. Earlier we distributed the framework as PaySDK.xcframework.zip through GitHub (Private repo) with two dependent xcframeworks.
Now, one of the clients asking to distribute the framework through Swift Package Manager.
I have created a new Private repo in the GitHub, created the new release (iOSSDK_SPM_Test) tag 1.0.0. Uploaded the below frameworks as Assets and updated the downloadable path in the Package.Swift and pushed to the GitHub Main branch.
PaySDK.xcframework.zip
PaySDKDependentOne.xcframework.zip
PaySDKDependentTwo.xcframework.zip
When I try to integrate (testing) the (https://github.com/YuvaRepo/iOSSDK_SPM_Test) in Xcode, am not able to download the frameworks, the downloadable path is pointing to some old path (may be cache - https://github.com/YuvaRepo/iOSSDK_SPM/releases/download/1.2.0/PaySDK.xcframework.zip).
Package.Swift:
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "iOSSDK_SPM_Test",
platforms: [
.iOS(.v13)
],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "iOSSDK_SPM_Test",
targets: ["PaySDK", "PaySDKDependentOne", "PaySDKDependentTwo"]
)
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.binaryTarget(
name: "PaySDK",
url: "https://github.com/YuvaRepo/iOSSDK_SPM_Test/releases/download/1.0.0/PaySDK.xcframework.zip",
checksum: " checksum "
),
.binaryTarget(
name: "PaySDKDependentOne",
url: "https://github.com/YuvaRepo/iOSSDK_SPM_Test/releases/download/1.0.0/PaySDKDependentOne.xcframework.zip",
checksum: " checksum "
),
.binaryTarget(
name: "PaySDKDependentTwo",
url: "https://github.com/YuvaRepo/iOSSDK_SPM_Test/releases/download/1.0.0/PaySDKDependentTwo.xcframework.zip",
checksum: " checksum "
),
.testTarget(
name: "iOSSDK_SPM_TestTests",
dependencies: ["PaySDK", "PaySDKDependentOne", "PaySDKDependentTwo"]
)
]
)
Steps I followed:
I have tried below steps,
Removed the local repo and cloned new
rm -rf ~/Library/Caches/org.swift.swiftpm/
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Can anyone help to identify the issue and resolve? Thanks in advance.
Hi there, I'd like to try working with Xcode, but my Mid 2015 MacBook Pro is running macOS Monterey (12.7.6).
I'm not looking to publish to the store right now, but I have some app ideas I'd like to put together and test out. Does anyone know if there's an older version of Xcode available I can use to try out my ideas?
Thank you for any help!
Hello, I see that others have had this problem, but I don't see any answers. I am making an IOS build in Unity and when I run it in Xcode Xcode 15.4, on macOS 14.6.1, I get the error above.
Following the advice of Apple help, I re-installed CocoaPods to the latest version and installed Unity dependencies. This resulted in failure with same message.
If I add Firebase using nano Podfile, I get a different failure code, (FirebaseCoreInternal: HeartbeatsPayload - no such module)
Build still doesn't work.
Any suggestions much appreciated
The problem is:
As per screenshot below, one can only see the lineChart. I have another struct AffiliateView coded under this Chart:
import SnapKit
import Charts
import DGCharts
class AffiliateViewController: UIViewController {
private lazy var chartView: LineChartView = {
let chart = LineChartView()
chart.noDataText = "No data available."
chart.chartDescription.enabled = false
chart.xAxis.labelPosition = .bottom
chart.rightAxis.enabled = false
chart.legend.enabled = true
chart.backgroundColor = .lightGray // For debugging visibility
return chart
}()
private lazy var containerView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
// Add container view and chart view to the main view
view.addSubview(containerView)
view.addSubview(chartView)
// Add SwiftUI View inside the container view
let affiliateView = AffiliateView()
let hostingController = UIHostingController(rootView: affiliateView)
addChild(hostingController)
containerView.addSubview(hostingController.view)
hostingController.view.frame = containerView.bounds
hostingController.didMove(toParent: self)
layout()
setupChartData()
}
private func layout() {
// Layout the container view (SwiftUI content)
containerView.snp.makeConstraints { make in
make.top.equalTo(view.safeAreaLayoutGuide.snp.top)
make.left.right.equalToSuperview()
make.height.equalTo(350) // Increase the height for the SwiftUI content
}
// Layout the chart view below the container view
chartView.snp.makeConstraints { make in
make.top.equalTo(containerView.snp.bottom).offset(20) // Space between chart and the affiliate content
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.height.equalTo(200) // Set a fixed height for the chart
}
}
private func setupChartData() {
let dataEntries = [
ChartDataEntry(x: 1, y: 10),
ChartDataEntry(x: 2, y: 20),
ChartDataEntry(x: 3, y: 15),
ChartDataEntry(x: 4, y: 30),
ChartDataEntry(x: 5, y: 25)
]
let dataSet = LineChartDataSet(entries: dataEntries, label: "Clicks per Day")
dataSet.colors = [.blue]
dataSet.valueColors = [.black]
dataSet.circleColors = [.red]
dataSet.circleRadius = 4.0
let data = LineChartData(dataSet: dataSet)
chartView.data = data
chartView.notifyDataSetChanged()
}
}
// SwiftUI View remains in the same file
struct AffiliateView: View {
@State private var customMessage: String = ""
@State private var uniqueLink: String = "Your unique link will appear here."
@State private var clickData: [Double] = [10, 20, 15, 30, 25] // Example data
var body: some View {
NavigationView {
VStack(spacing: 20) {
// TextField for custom message input
TextField("Enter your custom message...", text: $customMessage)
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding(.horizontal)
// Generate Link Button
Button(action: generateLink) {
Text("Generate Sign-Up Link")
.font(.headline)
.foregroundColor(.white)
.frame(maxWidth: .infinity, maxHeight: 50)
.background(Color.red)
.cornerRadius(10)
}
.padding(.horizontal)
// Generated Link Label
Text(uniqueLink)
.font(.body)
.multilineTextAlignment(.center)
.padding(.horizontal)
// You can add a chart here if you want to show it in SwiftUI too
/* LineChartView(data: clickData, title: "Clicks per Day", legend: "Daily Clicks") */
}
.navigationTitle("Affiliate Marketing")
.navigationBarTitleDisplayMode(.inline)
}
}
private func generateLink() {
let encodedMessage = customMessage.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? ""
uniqueLink = "https://affiliate.example.com/referral?message=\(encodedMessage)"
addClickData()
}
private func addClickData() {
clickData.append(Double.random(in: 0...100))
}
}
As you see, the AffiliateView has been declared outside of Controller View class. The View content was visible before the lineChart was added into this code. Now the View content is not visible anymore. I have tried to increment/decrement values at make.height.equalTo() but to no avail.
Could anyone kindly point me in the right direction?
Hi everyone,
I’ve been experiencing a persistent issue with my MacBook Pro (M2 Pro, macOS 15.2) when using Xcode (version 16.2). If Xcode is open and my Mac goes into sleep mode, the screen size changes upon waking. Specifically, I notice 3mm bezels appear on each side of the screen, making the display slightly smaller, and everything scales down to fit this reduced size.
This issue happens multiple times a day and has been ongoing for over a year. It’s quite disruptive to my workflow.
Here is a video to illustrate the problem:
Has anyone encountered this before? If so, do you have any suggestions for fixing it or steps I can take to debug the issue?
Thanks in advance for your help and support!
in Apple documentation:
https://developer.apple.com/documentation/pdfkit/pdfannotationbuttonwidget/setbackgroundcolor(_:)?language=objc
What is the alternative (to set window background) ?
Usually there is a checkbox for whether Xcode project is initiating git when creating new project. However this option is disappear on Xcode 16 (16.2 to be exact).
I've tried (see attached files):
Check on my Setting > Accounts > Source Control. My github account is there and the SSH key is intact.
Restarting Mac, then re-open Xcode
But still, no hope.
Ofcourse I still have option to init the git manually on the project via Finder, but that's not my point.
I can connect before update macOS and xcode
I discovered a disk space issue with Xcode on my 1TB hard disk. Xcode doesn’t delete old or unused Simulators, causing them to mix and consume valuable space. Deleting them from the Window > Devices & Simulators menu didn’t work, so I used Disk Utility to find and delete them. However, they persisted.
To regain disk space, I completely removed Xcode and the Developer Folder. After reinstalling Xcode, I regained about 80% of my disk space. Despite unmounting the Simulators, they remained.
For those unable or unwilling to do this, the Mac App Store offers DevCleaner, a utility that removes old Xcode Cache and Simulators.
Thanks. I hope I've helped someone else.
Dan Uff
Xcode 16.2 are unavailable to develop widget with dynamic options, no matter SiriIntent or AppIntent that I try to use.
I have try to start a complete new project, then add widget with app intent checkbox check, with zero code changed then i press command run and WidgetKit Simulator present CHSErrorDomain error 1103 always, if i try to add widget directly from desktop, dynamic options are available to select but widgets doesn't seem like load successfully, it is stuck same in the WidgetKit Simulator.
I also try to start a new project in my other MacBook but no luck, this error are presenting all the time, I'm totally stuck here, does anybody having this issue?
在更新Xcode以及系统版本后,就出现了Module 'Foundation' is needed but has not been provided, and implicit use of module files is disabled的报错,但该问题在Xcode 15,以及上一个系统版本中,并不存在,且可以正常的编译、运行以及打包