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
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
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.
Is there any good LMS framework that can be easily integrated to develop educational apps.
It should have scoring, questionnaire, gamification , certificate generation etc.
Any framework as easy as few lines of code and good payment structure would be good idea.
I am trying to display a 3D model in iOS app using RealityView. The same 3D model is displayed successfully in the visionOS app. Everything works perfectly only when I set my project’s minimum deployment target to iOS 18.0.
However, my app’s minimum deployment target is iOS 15.0. When I use the RealityKitContent package to load the 3D model, it fails to compile and gives me the following error:
Compiling for iOS 15.0, but module 'RealityKitContent' has a minimum deployment target of iOS 18.0: /Users/Library/Developer/Xcode/DerivedData/RealityViewForiOS-cbfkgimsqngtuegqwvezusvscllf/Index.noindex/Build/Products/Debug-iphonesimulator/RealityKitContent.swiftmodule/arm64-apple-ios-simulator.swiftmodule
I have made the RealityKitContent package optional and tried importing using the following condition:
#if canImport(RealityKitContent)
import RealityKitContent
#endif
Despite this, it still fails to compile and produces the same error. I have not found a workaround for using the RealityKitContent package with app targets lower than iOS 18.0.
Here is my package definition:
let package = Package(
name: "RealityKitContent",
platforms: [
.visionOS(.v1),
.macOS(.v15),
.iOS(.v18)
],
products: [
.library(
name: "RealityKitContent",
targets: ["RealityKitContent"]),
],
dependencies: [],
targets: [
.target(
name: "RealityKitContent",
dependencies: []),
]
)
Here is the code I am using to load the 3D model with RealityView using the RealityKitContent package:
import SwiftUI
import RealityKit
#if canImport(RealityKitContent)
import RealityKitContent
#endif
struct ContentView: View {
var body: some View {
VStack {
if #available(iOS 18.0, *) {
RealityView { content in
if let scene = try? await Entity(named: "Scene", in: realityKitContentBundle) {
content.add(scene)
}
} update: { content in
if let scene = content.entities.first {
let uniformScale: Float = 3.0
scene.transform.scale = [uniformScale, uniformScale, uniformScale]
}
}
} else {
// Fallback for earlier versions
}
}
}
}
#Preview {
ContentView()
}
Any help or guidance on how to use the RealityKitContent package for app targets lower than iOS 18.0 would be greatly appreciated.
Open a photo in your phone photo album and swipe up to see more information. Some pictures have "Saved from ***". How can I get this information, or how to get this content through PHAsset.
like to (https://i.sstatic.net/c8oVS.png)
Is it possible to put an video on loop and autoplaying for visionOS? We used AVPlayerViewController
Which framework or low level module can be used to allow a swift app to take a screenshot of the homes creen of an iOS device connected to the USB port?
I have seen several commercial apps that can to it, so there must be a module or framework they are using (and is not libimobile3, it must be apple native code)
** BUILD FAILED **
The following build commands failed:
Ld /Users/siddesh/Library/Developer/Xcode/DerivedData/App-ddpkkzvberburtewkcvoihnirgjh/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/Logging.build/Objects-normal/x86_64/Binary/Logging normal x86_64 (in target 'Logging' from project 'Pods')
(1 failure)
Testing with xcodebuild.
-> mySDK_Staging (8.8.0)
- WARN | attributes: Missing required attribute license.
- WARN | license: Missing license type.
- WARN | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
- WARN | [iOS] license: Unable to find a license file
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
- NOTE | xcodebuild: note: Using codesigning identity override: -
- NOTE | [iOS] xcodebuild: note: Building targets in dependency order
- NOTE | [iOS] xcodebuild: note: Target dependency graph (20 targets)