Since we migrated to Xcode 15.4, we are facing a crash of one of our application on Intel machines due to a missing symbol error:
Symbol not found: _$s7Network13NWPathMonitorCMa
This symbol is used by one of our internal SPM packages, targeting macOS 10.13, but the code using it is tagged @available(macOS 10.14.0, *).
After investigating, I can fix this crash by targeting 10.14 instead of 10.13 in package manifest. Sadly, this is not an option, as this SPM is used by products that supports macOS 10.13.
The linked libraries reported by otool differs significantly between the build targetting 10.13 and the build targetting 10.15:
The build targetting 10.13 weakly links links to
/System/Library/Frameworks/Network.framework/Versions/A/Network
The build targetting 10.15 does not link to Network.framework, but does link (not wealky) to a library that didn't appear before
/usr/lib/swift/libswiftNetwork.dylib
In previous builds that were performed by Xcode 14, the produced binary was weakly linking to
@rpath/libswiftNetwork.dylib
What can I do to work around this problem introduced by Xcode 15 ?
Swift Packages
RSS for tagCreate reusable code, organize it in a lightweight way, and share it across Xcode projects and with other developers using Swift Packages.
Posts under Swift Packages tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
🚀 I am thrilled to announce my latest open-source project, RJSwiftMacros!
This Swift package enables developers to enhance efficiency by simplifying code generation and automating repetitive tasks in their projects. 🔥
Here's a glimpse of what you can accomplish with RJSwiftMacros:
Generate mock data using @MockBuilder macro.
Generate coding keys using @CodingKeys macro.
RJSwiftMacros is actively maintained and welcomes contributions! 🤝
🔗 GitHub Repository: https://lnkd.in/dPikQTjD
I look forward to your feedback and ideas to further enhance its value for the Swift community. 💻
I have a large old macOS app project (15 targets, 15 years old) in a workspace. It was building fine until yesterday afternoon, when I attempted to do a Git Stash in Xcode. This caused Xcode 16.1 Beta which I was using to crash, and after that this Xcode crashed on launch. Trying Xcode 15.4, 16.0 Beta 6 and 16.1 Beta, in macOS 15 Beta, the only Xcode I can get to launch now is 16.0 Beta (further details of that are available upon request, but not my problem at this time).
My current problem is that the first Build task, Package Resolution, now fails with this error message:
Failed to resolve dependencies
Dependencies could not be resolved because root depends on 'swift-argument-parser' 1.3.0..<2.0.0 and root depends on 'swift-argument-parser' 0.4.3..<1.0.0.
Indeed, the project has a Package Dependency on swift-argument-parser 1.3.0 < 2.0.0. But I have no idea where Xcode is getting the other version string "0.4.3" from. And I don't know what "root" is being referred to, and whether or not it is the same "root" in both clauses of that error message. I have searched the relevant .pbxproj file, and indeed the whole project folder using BBEdit's Multi-File Search, and it could not find the text string "0.4.3" in this context anywhere. Where might that "0.4.3" be coming from?
Thank you.
Hi, I have a workspace with a couple of modules, and now I'm making a Swift package. It's great.
However, i have this SwiftUI View extension you can see at the end of this post. My Swift package needs to have the target set to IOS16, so i have added #available where I need, like I've done in the past.
When i had this extension in my Widget extension target, it worked fine. However, i am now trying to move that into my new Swift package, with the Swift package declaration you can also find below.
When moved, i get an error from the compiler:
Type 'ContainerBackgroundPlacement' has no member 'widget'
It seems that my #available is ignored? I'm at a loss as to why this happens, so if anyone has any ideas i'm all ears. Otherwise guess i'll have to move it back to the Widget extension target :(
My extension code:
extension View {
func widgetBackground(_ color: Color) -> some View {
if #available(iOSApplicationExtension 17.0, *), #available(iOS 17.0, *) {
return containerBackground(color, for: .widget)
} else {
return background(color)
}
}
.....more stuff
}
Swift Package (i renamed and cropped some stuff for simplicity):
import PackageDescription
let package = Package(
name: "MyPackage",
platforms: [
.iOS(.v16)
],
products: [
.library(
name: "MyPackage",
targets: ["MyPackage"]
)
],
targets: [
.target(
name: "MyPackage"
),
.testTarget(
name: "MyPackageTests",
dependencies: ["MyPackage"]
)
]
)
RealityContentKit bundle resource issue
Recently I always encounter weird loading bugs from RealityKitContent bundle. When I was trying to load audio resource as AudioFileResource or AudioFileGroupResource by loading from *.usda from RealityKitContent bundle, with this method. My code is nothing complicated but simple as below:
let primPath: String = "/SampleAudios/SE_bounce_audio"
guard let resource = try? AudioFileGroupResource.load(named: primPath, from: "MyScene.usda", in: realityKitContentBundle) else {
return
}
And the runtime program "sometimes"(whenever I change something RCP it somethings work again but the behavior is unpredictable) reports that it "Cannot find MyScene.usda:/SampleAudios/SE_bounce_audio in RealityKitContent.bundle".
I put MyScene.usda under the root folder of RealityKitContent package because I found that RealityKit just cannot find any *.usda scene if you didn't put that on the root level (could be a bug because of the way it indexes its files).
I even double checked my .usda file with usdview, the primPath is absolutely correct. I think there are some unknown issues when RealityKitContent copy resources and build the package. I tried to play with the package Package.swift file a bit to see if I could manually copy my resources (everything) and let the package carry my resources but it just didn't work. So right now I just keep this file untouched below (just upgrade the swift-tools-version to 6.0 as only that can supports .visionOS(.v2)):
// swift-tools-version:6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "RealityKitContent",
platforms: [
.visionOS(.v2)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "RealityKitContent",
targets: ["RealityKitContent"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "RealityKitContent"
),
]
)
That is just issue one, RealityKitContent package build issue.
Audio file format issue
Another is about Audio File Format RCP supports. I remember is a place (WWDC?) saying .wav and .mp4 are supported to be used as audio source. But when I try to set up Spatial Audio, I find sometimes *.wav or *.mp3 can also be imported as AudioSourceFile. But the behavior is unpredictable. With two *.wav files SE_ball_hit_01.wav and SE_ball_hit_02.wav, only SE_ball_hit_01.wav is supported, 02 is reported as the format is not supported/ Check out my screenshots to see the details of two files. Two files have almost the same format (same sample rate or channel).
I understand there might be different requirements for a source file to be used as Spatial or Ambient audio. But I haven't figured that out or there is nothing I can find helpful on Apple Documentation. So what is the rules?
Thanks for reading and any thought is welcomed.
when I try to import CompositorServices, I get an error for:
dyld[596]: Symbol not found: _$sSo13cp_drawable_tV18CompositorServicesE17computeProjection37normalizedDeviceCoordinatesConvention9viewIndexSo13simd_float4x4aSo0A26_axis_direction_conventionV_SitF
Referenced from: /private/var/containers/Bundle/Application/33008953-150D-4888-9860-28F41E916655/VolumeRenderingVision.app/VolumeRenderingVision.debug.dylib
Expected in: <968F7985-72C8-30D7-866C-AD8A1B8E7EE6> /System/Library/Frameworks/CompositorServices.framework/CompositorServices
The app wrongly refers to my Mac's local directory. However, I chose Vision Pro as a running device. My Mac has been updated to macOS 15 beta 7, and I have not had the same issue before.
Hi Team ,
We are having an issue that when we open the Xcode and switch any git branches(either through Xcode or using any other git GUI tools) the package.resolved file is getting deleted automatically
So we need to reset the git each time on a branch switch to regenerate the package.resolved file
Please note if the Xcode is quit and if we do the branch switching from an external git GUI, this issue is not happening
Also there is no change is added to the package.resolved file between these two branhces , So theoritically there is no need of updating this file while we switch the branch
How to capture program crash exceptions with swift UI
Hello,
I've been working on my macos app for months, today I opened XCode, and it's full of the same errors "Value of type 'URL' has no member 'url''" and "Cannot convert value of type 'Binding' to expected argument type 'CGFloat'". I didn't change ANYTHING, I didn't update nor remove anything, the 3rd party module I'm using didn't get updated, this is all out of the blue!
I tried to clean the build folder, erase the derivated data, rebuild a new project, these errors won't go away...worst part is that another of my app use the same codes and there I see the errors but the app still compiles and build!!
I have a project that uses local SPM packages for modularization. In one of my local SPM packages I have a .storyboard file that gets packaged as a resource in the SPM package and consumed inside the parent.
In Xcode 15.4, the resource bundle for my local SPM Package has the bundle id PackageName-TargetName-resources. I use this inside a parent storyboard to reference the storyboard from the SPM package.
In Xcode 16, however, the resource bundle for my SPM Package gets assigned the bundle id packagename.TargetName.resources.
This, of courses, introduces a crash in builds of my app done with Xcode 16 due to the incorrect bundle id.
There is no documentation of this change that I could find by Apple or by the SPM team.
Apple Team: There is a Feedback Report FB14803020 with the build files attached from Xcode 15.4 and Xcode 16. I cannot attach those here due to the public nature of this forum
Is there any good framework that can be used in educational app as Learning Management System (LMS).
Should be full fledge for creating courseware for E Learning App.
Should be compatible with all Apple Platforms.
Any help or link will be greatly appreciated. As I didn't found anything that mentions designed for Xcode. All LMS belong to Web based apps.
Hello,
I get this error:
How can I fix it and hope you can help me.
greetings Fabian
SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'de.polygondata.BikeComputer.BikeComputerWidget' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x600000c37150 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)}}, FBSOpenApplicationRequestID=0xbf3b, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}." UserInfo={NSLocalizedDescription=Failed to show Widget 'de.polygondata.BikeComputer.BikeComputerWidget' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x600000c37150 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)}}, FBSOpenApplicationRequestID=0xbf3b, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}., NSUnderlyingError=0x600000c36e50 {Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x600000c37150 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)}}, FBSOpenApplicationRequestID=0xbf3b, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}}}
Domain: DTXMessage
Code: 1
User Info: {
DVTErrorCreationDateKey = "2024-08-16 17:14:32 +0000";
}
SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'de.polygondata.BikeComputer.BikeComputerWidget' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x600000c37150 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)}}, FBSOpenApplicationRequestID=0xbf3b, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}." UserInfo={NSLocalizedDescription=Failed to show Widget 'de.polygondata.BikeComputer.BikeComputerWidget' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x600000c37150 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)}}, FBSOpenApplicationRequestID=0xbf3b, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}., NSUnderlyingError=0x600000c36e50 {Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace)., BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x600000c37150 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (de.polygondata.BikeComputer.BikeComputerWidget)}}, FBSOpenApplicationRequestID=0xbf3b, NSLocalizedDescription=The request to open "com.apple.springboard" failed.}}}
Domain: DTXMessage
Code: 1
I have created my own SPM through File -> New -> Package
Package.swift looks like:
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "MyPackage",
platforms: [.iOS(.v16), .macCatalyst(.v16), .macOS(.v14)],
products: [.library(name: "MyPackage", targets: ["MyPackage"]),],
dependencies: [
.package(path: "../external-package")
], targets: [
.target(name: "MyPackage", path: "Sources"),
.testTarget(name: "MyPackageTests", dependencies: ["MyPackage"]),
]
)
When I run swift build the error says:
'.../MyPackage/.build/arm64-apple-macosx/debug/external-package.build/external-package-Swift.h' not found
and surely, when I go to directory:
.../MyPackage/.build/arm64-apple-macosx/debug/external-package.build/
there are only 2 files in there:
module.modulemap & output-file-map.json
All source files from external-package are missing, therefore swift build fails. The only solution I've found is to copy external-package.build folder manually into:
'.../MyPackage/.build/arm64-apple-macosx/debug/`
What am I missing here? Should swift build create those files in there, or they should be resolved somehow differently?
Note: external-package is not in any way unique, this happens to any added dependency
I'm running on macOS 14.6.1 on Apple Silicon M1 Pro with Xcode 15.4
Hi, I am fairly new Xcode/Swift and am trying to load a CSV File for use in my development. I have placed the CSV file in my Assets folder but when I try to create my Data Model and load the CSV file. I run into the error: No exact matches in call to initializer. Below is the code. I have attached CSV File. Any help fixing this error would be greatly appreciated. Thanks in advance for your help.
Brian
Hospital_Demographic_Data_Sample.csv
import Foundation
import CSV
struct HospitalData: Codable {
let providerNumber: String
let hospital: String
let address: String
let city: String
let state: String
let zip: String
let wageIndex: Double
let caseMix: Double
let averageCharge: Double
let discharges: Int
let totalCharges: Double
let adjTotalCharges: Double
// Add other fields as needed based on the columns in your CSV file
}
func loadHospitalData() -> [HospitalData]? {
guard let filePath = Bundle.main.path(forResource: "Hospital_Demographic_Data", ofType: "csv") else {
print("File not found")
return nil
}
do {
let csv = try CSV(url: URL(fileURLWithPath: filePath))
var hospitalDataList = [HospitalData]() // Initialize as an empty array
for row in csv.namedRows {
if let providerNumber = String(row["Provider CCN"] ?? ""), // Replace "Provider CCN" with actual column name
let hospital = String(row["Hospital Name"] ?? ""), // Replace with actual column name
let address = String(row["Street Address"] ?? ""),
let city = String(row["City"] ?? ""), // Replace with actual column name
let state = String(row["State Code"] ?? ""), // Replace with actual column name
let zip = String(row["Zip Code"] ?? ""), // Replace with actual column name
let wageIndex = Double(row["Wage Index"] ?? ""),
let caseMix = Double(row["Case Max"] ?? ""),
let averageCharge = Double(row["Base Charge"] ?? ""), // Replace with actual column name
let discharges = Int(row["Medicare Discharges"] ?? ""),
let totalCharges = Double(row["Total Charges"] ?? ""),
let adjTotalCharges = Double(row["Total Wage Normalized Charges"] ?? "") { // Replace with actual column name
let hospitalData = HospitalData(
providerNumber: providerNumber,
hospital: hospital,
address: address,
city: city,
state: state,
zip: zip,
wageIndex: wageIndex,
caseMix: caseMix,
averageCharge: averageCharge,
discharges: discharges,
totalCharges: totalCharges,
adjTotalCharges: adjTotalCharges
)
hospitalDataList.append(hospitalData)
}
}
return hospitalDataList
} catch {
print("Failed to load CSV file: \(error)")
return nil
}
}
// Usage Example
func main() {
if let hospitalData = loadHospitalData() {
for data in hospitalData {
print("Hospital: (data.hospital), City: (data.city), Average Charge: (data.averageCharge)")
}
}
}
Using Xcode 15.4 and macOS Sonoma 14.6.1 and Reality Composer Pro 1.0.
Lately (I believe since updating to Xcode 15.4, not sure..), I'm getting build errors that I didn't get before. The error is saying that "the package manifest at /Package.swift cannot be accessed (/Package.swift doesn't exist in file system)".
When I click for more information and bring up the Resolve Packages - Log, it gives a red X error "Resolving Package Graph Failed"
I'm not sure why I'm recently getting this error. My Reality Composer Pro Package is part of my project and listed in my project navigator as it has been.
The Package.swift file is in the same file location as it has always been and I believe it is correct.
I tried removing the package from my project navigator then dragging and dropping it back into the project navigator, but I'm still getting the error.
Note: this error is only appearing on a working branch for a new version I'm working on. The error does not appear on my production (main) branch even though it is the same package and location in Finder and appears the same way in the main branch project navigator.
I get these same errors on Xcode 16 Beta 5.
I created an app using Playgrounds and added a Package from GIt. When I try running the app it fails saying the it doesn't support dynamic libraries. So, my question is why did it allow me to add the package in the first place?
Hi,
I have a question about packages in swift. I need to import package from this link https://github.com/jedisct1/swift-sodium. Readme show the way to import it with xcode. But I need to do it with gitlab-ci so I can't open xcode there and add dependency manually.
And this is my question. Is there any possibility to add package dependency to target with xcodebuild or swift-cli?
I've tried to do this with cocoapods but unfortunately it not working in my case. It is importing Sodium library but not Clibsodium package.
I'll be very glad if someone could help me wth this case.
Hi all,
I am fairly new to Swift development so go easy on me!
I am working through a few examples of using Reality Kit content within my projects and whilst trying to work on adding gestures to RealityKit entities, I have come across a weird issue.
Downloading and running the example here
This works fine for me.
When adding the same things to my own code - in this case a class called EntityGestureState to my GestureComponent file (within the reality kit project) I constantly get this error:
"Static property 'shared' is not concurrency-safe because it is non-isolated global shared mutable state"
Even just troubleshooting with something as simple as:
public class EntityGestureState {
// The entity currently being dragged if a gesture is in progress.
// Singleton shared instance
static let shared: EntityGestureState = EntityGestureState()
}
I immediately get the error and from a bunch of trial and error and reading different sources I can't seem to get around this.
Could anyone help here? I am running on Xcode 16 beta 3 so am wondering if it's a bug but also more than likely user-error.
I know that Xcode doesn't have explicit support in the UI for Package Registries yet, but can use packages referenced by ID if the registry is set up through the CLI.
I also see that xcodebuild has support for SCM to registry transformation (resolving and downloading packages through a registry, even if the packages are referenced using their Github URLs) through command line arguments like "-defaultPackageRegistryURL" and "-packageDependencySCMToRegistryTransformation".
Is there any way to achieve the same thing in Xcode itself?
In Xcode 16.0 beta 3 (16A5202i) I'm trying to add a framework to a target.
I'm clicking the '+' button under Target > General > Frameworks, Libraries, and Embedded Content:
When I do this, the dialog that appears doesn't list any frameworks:
I feel like I'm doing something wrong or missing something obvious. This issue is easy to reproduce by creating a new project in Xcode.
I tried reverting using Xcode 15 to add the framework that way, but Xcode 15 is unable to load the project file that Xcode 16 wrote.
Incidentally, Add Other > Add Package Dependency has no effect when selected:
Assuming this is a bug I should submit feedback about, is there another method I can use in the meantime to add a framework to my target so I can continue working?
This is blocking development.
Thank you for any help you provide.