I use spm manage swift package, now i want my macos app support arm64e,so i add arm64e in Build Srtting -> Architectures.
but i got error Could not find module 'SwiftyJSON' for target 'arm64e-apple-macos'; found: arm64-apple-macos, x86_64-apple-macos
Apparently, if no limit in Package.swift, SPM will only compile versions for x86 and ARM64 architectures by default.
now, how should I configure SPM to compile the arm64e version?
thanks
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
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I want to ensure that the main & test source of my macOS-only SwiftPM project (on GitHub at mas) builds via swift, xcodebuild & Xcode.
For builds of clean clones of the main branch (i.e. no locally edited files, no existing .build or .swiftpm folders, etc.):
The swift command line below builds main & test fine:
swift build --build-tests
The xcodebuild command line below doesn't seem to run the SwiftPM MASBuildToolPlugin (which generates a Swift file necessary for the build), which is setup for the project in Package.swift, so neither main nor test build:
xcodebuild -scheme MAS -destination "platform=macOS,arch=$(arch),variant=macos"
How can I get xcodebuild to run my MASBuildToolPlugin, or to run an equivalent?
In Xcode, building main works fine, so Xcode must run the SwiftPM MASBuildToolPlugin. Building test, however, fails with the following error:
No such module 'MAS'
If I capitalize the name of the executable in the following line in Package.swift from:
products: [.executable(name: "mas", targets: ["MAS"])],
to:
products: [.executable(name: "MAS", targets: ["MAS"])],
Then Xcode can compile the tests. That, however, sets the generated executable file's name to MAS, but I want it to be mas.
How can I use MAS for the package/module/target/etc. names in the source, but generate an executable file named mas?
I obviously can rename the executable after it has been generated by running mv MAS mas, but would the upper-case name be incorrectly used anywhere inside the executable? I assume not. Also, I'd prefer to setup my project properly, instead of using a file renaming hack.
This post documents an issue I reported in feedback FB19610114 and see if anyone knows of a workaround. Here is a copy of the feedback.
Short version
Manipulation (SwiftUI OR RealityKit) fails to translate entities after changing rooms. By changing rooms, I mean a human wearing an Apple Vision Pro leaving one room and entering another room. Once this issue occurs, it impacts all apps that use these features. A device restart is the only solution I have to fix it.
Feedback FB19610114
This is an odd one. I'm using the new Manipulation Component in visionOS 26. Most of the time this works well. Sometime it stops working and when it does the only way to get it working again is to reboot the headset.
When this happens, I can continue to rotate and scale items, but translation no longer works. It is as if the item is stuck to a fixed point in the parent scene (window, volume, etc). When this bug occurs, it affects every app across the entire operating system that is using manipulation, including the RealityKit component AND the SwiftUI version. This is not limited to one app and is not limited to apps that I am working on. Once this error occurs, it affects literally any application across the operating system that is using this API, including apps from Apple.
I won't speculate on the cause of this, but I do know of one way where I can always get it to happen.
Here is how to reproduce it:
Make an Xcode project with a single entity that uses the Manipulation Component. There is no need to customize the configuration of this component. The default implementation will work.
Build and run this app on device. You can keep running from device or quit and launch the app like normal on device.
Open the app and manipulate the entity - it should work as expected.
Physically walk into another room. It is vital that you leave the current room that you are in and enter a different room entirely.
Use the digital crown to recenter your view and bring your window or volume to you.
Test the manipulation on the entity again - it should still be working as expected at this point.
Physically, move yourself and your headset into the original room where you started.
Use the digital crown to recenter your view and bring your window or volume to you.
Test the manipulation on the entity again - you should now see the issue.
When I follow the steps above, then 100% of the time manipulation translation stops working at this point. It will impact any application using this API. The only way to fix it is to restart my headset.
A few points to keep in mind
It does not matter if an app is actively being run from Xcode.
When this occurs, it impacts every single app, not just one.
When this occurs, rotation and scaling continue to work, but the entity/view cannot be translated.
This impacts BOTH the SwiftUI version and the RealityKit version.
When this occurs, the only way to "fix" it is to reboot the device.
Goal: To render in an apple vision pro app, the solid-mechanics 3D simulation results coming form an FEA code.
Starting point: I have surface vtks with deformations on each node. Each time step has a a mesh with the nodal coordinates. This is straighforward translatable to a usd MeshSequence. Unfortunately, the results cannot be simplified to a scaling o linear transformation as you would do with other game-oriented animations.
Tools: Right now, I am using Xcode and reality composer pro (RCP) to build the scenes.
Technical limitations: I am aware that RCP can do animations with BlendMesh and skeletons and that MeshSequence is not a problem.
Progress:
Coverting to the sequence of vtk meshes to a usd MeshSequence is straighforward. This animates correctly in Preview and Blender (see screenshot).
I managed to convert from MeshSequence to multiple keys and BlendMesh. This also animates correctly in Blender and preview. Unfortunately, the BlendMesh of multiple blended meshes shows a zero animation time in RCP (see screenshot below)
Also, see below usda file scheme for the animation. Of course I am not showing full vectors such as faceVertexCounts, faceVertexIndex, normals.
Question: what is the right set up to create a BlendMesh animation that RCP will correctly import and animate, form a set of Meshes or multiple key shapes?
Blender animation
Time zero RCP "animations"
#usda 1.0
(
defaultPrim = "BlendMeshRoot"
doc = "Blender v4.5.3 LTS"
endTimeCode = 48
framesPerSecond = 24
metersPerUnit = 1
startTimeCode = 0
timeCodesPerSecond = 24
upAxis = "Z"
)
def Xform "BlendMeshRoot" (
customData = {
dictionary Blender = {
bool generated = 1
}
}
)
{
def SkelRoot "Mesh"
{
custom string userProperties:blender:object_name = "Mesh"
float3 xformOp:rotateXYZ = (89.99999, -0, 0)
float3 xformOp:scale = (0.009999999, 0.01, 0.01)
double3 xformOp:translate = (0, 0, 0)
uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"]
def Mesh "Mesh" (
active = true
prepend apiSchemas = ["MaterialBindingAPI", "SkelBindingAPI"]
)
{
uniform bool doubleSided = 1
float3[] extent = [(25.091871, -34.121277, -13.298501), (299.94482, 245.10088, 202.35126)]
int[] faceVertexCounts = [3, 3, ...
int[] faceVertexIndices = [0, 10293, ...
rel material:binding = </BlendMeshRoot/_materials/MeshSequence_Default>
normal3f[] normals = [(-0.3632836, -0.9102419, -0.19870725), ....
point3f[] points = [(244.41148, 155.42062, 70.454926),.....
float3[] primvars:node_displacement = [(93.54703, 110.9341, 48.37992)....
float3[] primvars:Normals = [(-0.0050530406, -0.9910114, -0.13368203),...
int[] primvars:skel:jointIndices = [0, 0, 0, 0, 0 ...
float[] primvars:skel:jointWeights = [1, 1, 1, 1, 1...
uniform token[] skel:blendShapes = ["frame_0000", "frame_0001", "frame_0002", "frame_0003", "frame_0004", "frame_0005"]
rel skel:blendShapeTargets = [
</BlendMeshRoot/Mesh/Mesh/frame_0000>,
.......
</BlendMeshRoot/Mesh/Mesh/frame_0005>,
]
prepend rel skel:skeleton = </BlendMeshRoot/Mesh/Skel>
uniform token subdivisionScheme = "none"
custom string userProperties:blender:data_name = "Mesh"
custom float userProperties:originalTime
float userProperties:originalTime.timeSamples = {
0: 0,
}
def BlendShape "frame_0000"
{
uniform vector3f[] offsets = [(0, 0, 0), (0, 0, 0),.....
uniform int[] pointIndices = [0, 1, 2, .....
}
.....
.....
#### BlendShape frame to 0005
.....
def Skeleton "Skel" (
prepend apiSchemas = ["SkelBindingAPI"]
)
{
uniform matrix4d[] bindTransforms = [( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )]
uniform token[] joints = ["joint1"]
uniform matrix4d[] restTransforms = [( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )]
prepend rel skel:animationSource = </BlendMeshRoot/Mesh/Skel/Anim>
def SkelAnimation "Anim"
{
uniform token[] blendShapes = ["frame_0000", "frame_0001", "frame_0002", "frame_0003", "frame_0004", "frame_0005"]
float[] blendShapeWeights.timeSamples = {
0: [1, 0, 0, 0, 0, 0],
1: [0.9697085, 0.03029152, 0, 0, 0, 0],
2: [0.88787615, 0.11212383, 0, 0, 0, 0],
.....
46: [0, 0, 0, 0, 0.11212379, 0.8878762],
47: [0, 0, 0, 0, 0.030291557, 0.96970844],
48: [0, 0, 0, 0, 0, 1],
}
}
}
}
def Scope "_materials"
{
def Material "MeshSequence_Default"
{
token outputs:surface.connect = </BlendMeshRoot/_materials/MeshSequence_Default/Principled_BSDF.outputs:surface>
custom string userProperties:blender:data_name = "MeshSequence_Default"
def Shader "Principled_BSDF"
{
uniform token info:id = "UsdPreviewSurface"
float inputs:clearcoat = 0
float inputs:clearcoatRoughness = 0.03
color3f inputs:diffuseColor = (0.8, 0.4, 0.3)
float inputs:ior = 1.5
float inputs:metallic = 0
float inputs:opacity = 1
float inputs:roughness = 0.5
float inputs:specular = 0.2
token outputs:surface
}
}
}
def Scope "AnimationClips"
{
custom rel animations = </BlendMeshRoot/Mesh/Skel/Anim>
}
def RealityKitComponent "AnimationLibrary"
{
custom rel animations = </BlendMeshRoot/Mesh/Skel/Anim>
custom token info:id = "RealityKit.AnimationLibrary"
custom double realitykit:approximateDuration = 2
custom double[] realitykit:clipDurations = [2]
custom string[] realitykit:clipNames = ["Anim"]
custom rel realitykit:clipTargets = </BlendMeshRoot/Mesh/Skel/Anim>
custom double realitykit:frameRate = 24
custom bool realitykit:isAnimationLibrary = 1
}
}
Topic:
Spatial Computing
SubTopic:
Reality Composer Pro
Tags:
Swift Packages
Developer Tools
Reality Converter
Reality Composer
I’m building a Flutter plugin to access the new menubar API on iPadOS. Everything works fine with a single scene, but I’m running into issues when adding support for multiple scenes:
Only odd-numbered windows (first, third, etc.) build their menus correctly.
Even-numbered windows ignore the menus sent from Flutter and fall back to a default menubar.
When switching between scenes, the last rendered menu always persists instead of updating to the current focus.
So far, I’ve:
Implemented the plugin as a singleton.
Tried to persist menu state per scene, but without success.
What would be the recommended approach here? Should I avoid a singleton and manage state entirely per UIScene instance?
The project is open-source, and if anyone is willing to take a look, here are the relevant files:
/ios/Classes/IpadOSMenubarPlugin.swift
/example/ios/Runner/AppDelegate.swift
Any guidance would be much appreciated.
When the app kills the process. Received APNs push message. Push messages carry voice related information. At the same time as receiving the push, obtain the voice playback of this voice message. How to achieve it?
HELP ME someone is using all of these tools etc and have been hacking all of my devices and iClouds and certain apps using HomeKit iCloud kit Xcode and I need someone to help me debug my phone or teach me what to do they are using hardware or external / sharing across devices / and it’s seriously affecting my physical and mental health. I have contacted the FBI and have a meeting in October but I’m hoping someone can help me in the time being please it’s all of my devices and daugters tabelts / doesn’t matter if it’s android or iPhone . help plssss
Topic:
Community
SubTopic:
Apple Developers
Tags:
Swift Packages
Developer Tools
CarPlay
External Accessory
I have created a build tool plugin in one of my SPM packages, and am trying to get it working in my project. It works fine when I build from Xcode, or have at least built the project in Xcode once before with the plugin.
But if I try to build the project using xcodebuild on a machine where I have never built the project before, it fails with this error:
error: '2.3.0': Invalid manifest (compiled with: ["/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc", "-vfsoverlay", "/var/folders/5_/q4yl04gs2kld1zztqxkqjdgh0000gq/T/TemporaryDirectory.BWwJWG/vfs.yaml", "-L", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-target", "arm64-apple-macosx14.0", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk", "-F", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks", "-F", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks", "-I", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib", "-L", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib", "-swift-version", "5", "-I", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk", "-package-description-version", "5.7.0", "/private/var/folders/5_/q4yl04gs2kld1zztqxkqjdgh0000gq/T/SwiftTemplate/1FA05B4D-851D-4D2B-ADD6-E5A0DF70CD37/2.3.0/Package.swift", "-o", "/var/folders/5_/q4yl04gs2kld1zztqxkqjdgh0000gq/T/TemporaryDirectory.HUxmAq/2.3.0-manifest"])
<unknown>:0: error: error opening '/var/folders/5_/q4yl04gs2kld1zztqxkqjdgh0000gq/C/clang/ModuleCache/PackageDescription-3TZGMDBKTLI5E.swiftmodule' for output: /var/folders/5_/q4yl04gs2kld1zztqxkqjdgh0000gq/C/clang/ModuleCache/PackageDescription-3TZGMDBKTLI5E.swiftmodule: Operation not permitted
/private/var/folders/5_/q4yl04gs2kld1zztqxkqjdgh0000gq/T/SwiftTemplate/1FA05B4D-851D-4D2B-ADD6-E5A0DF70CD37/2.3.0/Package.swift:4:8: error: failed to build module 'PackageDescription' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
3 |
4 | import PackageDescription
| `- error: failed to build module 'PackageDescription' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
5 |
6 | let package = Package(
On a machine where this isn't working, if I open Xcode and build the project once, then xcodebuild will succeed. Even if the Xcode build fails because I didn't choose to trust the plugin. I first ran into this on our CI server, and confirmed the same behavior by creating a brand new user account on my Mac and reproducing there.
Oddly I am not able to recreate the failure after it is fixed by Xcode, even after deleting every conceivable SPM related cache.
This is the command I used (I've added a bunch of sandbox stuff to the command, with no effect):
xcodebuild -workspace Zinnia.xcworkspace -scheme Zinnia -disableAutomaticPackageResolution -skipPackagePluginValidation -IDEPackageSupportDisableManifestSandbox=1 -IDEPackageSupportDisablePluginExecutionSandbox=1 OTHER_SWIFT_FLAGS='$(inherited) -disable-sandbox' clean test
Here is the output immediately prior to the error:
Prepare packages
Compile plug-in “PixiteDependencyGenerator” in package “pixitedependency”
[debug]: Compiling plugin to executable at /Users/natetemp/Library/Developer/Xcode/DerivedData/Zinnia-aqyjcevbunlgbtgcippbjzhhpyax/Build/Products/PluginExecutables/PixiteDependencyGenerator
[debug]: Using compiler /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc
[debug]: Plugin compilation output directory '/Users/natetemp/Library/Developer/Xcode/DerivedData/Zinnia-aqyjcevbunlgbtgcippbjzhhpyax/Build/Products/PluginExecutables'
[debug]: Computed hash of plugin compilation inputs: 44c01fc622391970b4c18b2a5fa100e2e0fa23e272829e41b575ef79872ec8f2
Apply build tool plug-in “PixiteDependencyGenerator” to target “Zinnia” in project “Zinnia”
/usr/bin/sandbox-exec -p "(version 1)
(deny default)
(import \"system.sb\")
(allow file-read*)
(allow process*)
(allow mach-lookup (global-name \"com.apple.lsd.mapdb\"))
(allow file-write*
(subpath \"/private/tmp\")
(subpath \"/private/var/folders/5_/q4yl04gs2kld1zztqxkqjdgh0000gq/T\")
)
(deny file-write*
(subpath \"/Users/natetemp/projects/pixite/Zinnia\")
)
(allow file-write*
(subpath \"/Users/natetemp/Library/Developer/Xcode/DerivedData/Zinnia-aqyjcevbunlgbtgcippbjzhhpyax/Build/Intermediates.noindex/BuildToolPluginIntermediates/Zinnia.output/Zinnia/PixiteDependencyGenerator\")
(subpath \"/private/var/folders/5_/q4yl04gs2kld1zztqxkqjdgh0000gq/T/TemporaryItems\")
)
" /Users/natetemp/Library/Developer/Xcode/DerivedData/Zinnia-aqyjcevbunlgbtgcippbjzhhpyax/SourcePackages/artifacts/pixitedependency/Sourcery/sourcery-2.3.0.artifactbundle/sourcery/bin/sourcery --templates /Users/natetemp/Library/Developer/Xcode/DerivedData/Zinnia-aqyjcevbunlgbtgcippbjzhhpyax/SourcePackages/artifacts/pixitedependency/Sourcery/sourcery-2.3.0.artifactbundle/sourcery/Templates --output /Users/natetemp/Library/Developer/Xcode/DerivedData/Zinnia-aqyjcevbunlgbtgcippbjzhhpyax/Build/Intermediates.noindex/BuildToolPluginIntermediates/Zinnia.output/Zinnia/PixiteDependencyGenerator/GeneratedSources --cacheBasePath /Users/natetemp/Library/Developer/Xcode/DerivedData/Zinnia-aqyjcevbunlgbtgcippbjzhhpyax/Build/Intermediates.noindex/BuildToolPluginIntermediates/Zinnia.output/Zinnia/PixiteDependencyGenerator/Cache --sources /Users/natetemp/projects/pixite/Zinnia/Zinnia
For the record, I did ensure that the 3 directories it complains about do exist with proper permissions.
Is it possible that the sandbox being applied to the plugin is also being incorrectly applied to something involved in parsing and caching the manifest file? Or if there is something I am doing wrong, please let me know.
This is using Xcode 16.4 on macOS 15.5.
In the ScoreKeeper tutorial there's the following code:
ForEach($players) { $player in
GridRow {
TextField("Name", text: $player.name)
Text("\(player.score)")
Stepper("\(player.score)", value: $player.score)
.labelsHidden()
}
}
Can someone please explain why the 2 instances of "player.score" are not preceded by "$". Thanks!
Good day!
When your project have total 887 or more SPM local targets and then you try to build it, xcodebuild will be crash.
Crash log:
SWBBuildService-2025-08-11-151103.ips
Thread 2 Crashed:: Dispatch queue: com.apple.root.default-qos.cooperative
0 libxpc.dylib 0x197c4826c _availability_version_check + 8
1 libswiftCore.dylib 0x1a9b44428 __isPlatformVersionAtLeast + 92
2 libswiftCore.dylib 0x1a9a6e054 _swift_allocObject_ + 1100
3 SWBMacro 0x104a9c408 specialized _ArrayBuffer._consumeAndCreateNew(bufferIsUnique:minimumCapacity:growForAppend:) + 116
4 SWBMacro 0x104a97b58 specialized Array.append<A>(contentsOf:) + 116
5 SWBMacro 0x104a954e8 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 160
6 SWBMacro 0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352
7 SWBMacro 0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352
8 SWBMacro 0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352
9 SWBMacro 0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352
10 SWBMacro 0x104a96548 MacroEvaluationProgram.executeInContext(_:withResultBuilder:alwaysEvalAsString:) + 4352
But if you try to build Package.swift via swift build command, it works.
Here you can open sample project:
Just Package.swift with SPM 900 targets
Open Package.swift via Xcode 26 any beta and try to build
Xcode workspace with SPM 900 targets
Open MyApp.xcworkspace and try to build
You can also make by self the Package.swift (also make required directories for SPM):
// swift-tools-version: 5.9
import PackageDescription
// let count = 800 // no crash
let count = 900 // crash
let targetsNames = (1...count).map { "Pkg1Target\($0)" }
let targets = targetsNames.map { Target.target(name: $0) }
let package = Package(
name: "Pkg1TargetLibrary",
platforms: [.iOS(.v16)],
products: [
.library(name: "Pkg1TargetLibrary", targets: targets.map(\.name)),
],
targets: targets
)
Is anyone have this problem on xcode 26 ?
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility50
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility51
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility56
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibilityConcurrency
Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibilityDynamicReplacements
Hi,
I am looking for guidance on how to create a scrollable song list, such as the attachment. The song list was originally created in C#, using an RTF object and populated by about 43 lines of song criteria.
What similar approach would I use in Swift and MacOS?
By the way, I currently play music that resides on the Mac, no external streaming is required or desired.
Thanks, Jim
Steps to reproduce:
Create a default document-based app for iOS using SwiftUI or UIKit with UIDocumentViewController.
In the document loading method, simulate an error by throwing an exception, for example: throw CocoaError(.coderValueNotFound)
Open the app on device/simulator running iOS 18 and attempt to open or create a new document.
Expected behavior:
An appropriate error message should be displayed to the user.
Actual behavior:
No error message is shown to the user
The "Create Document" button becomes permanently disabled
The app appears to hang or become unresponsive
Environment:
iOS 18, 26 beta 9
Both UIKit and SwiftUI implementations affected
Has anyone encountered this issue or found a workaround?
This seems like a regression in iOS 18's document handling.
FB20189617, FB20189669
I am an SDK provider working with Swift Package Manager (SPM) to deliver libraries for iOS developers. My SDK currently uses SPM targets to modularize functionality. However, SPM enforces strict resource bundling, which prevents me from efficiently offering multiple targets—each with a different set of localization files—in a single package.
Current Limitation:
When multiple SPM targets share the same source and resource directory but require distinct sets of .lproj localization folders (for app size or client requirements), SPM raises “overlapping sources” errors. The only workaround is to manually split resource directories or have clients prune localizations post-build, which is inefficient and error-prone.
Feature Request:
Please consider adding native support in Swift Package Manager for:
Defining multiple targets within a single package that can process overlapping source/resource directories,
Each target specifying a distinct subset of localization resource files via the exclude or a new designated parameter,
Enabling efficient modular delivery of SDKs to clients needing different localization payloads, without redundant resource duplication or error-prone manual pruning.
Support for this feature would greatly ease SDK distribution, lower app sizes, and improve package maintainability for iOS and all Swift platforms.
How can you distribute an XCFramework via Swift Package Manager when it has dependencies on other Swift packages? We accomplished this with CocoaPods in order to distribute our closed source SDK that has dependencies, but need to migrate to SPM. Note none of the types from the dependencies are used as part of our module’s public interface - usage is purely internal.
I’ve made a lot of progress following these steps for a simple example:
Create Framework Project
Create a new iOS Framework project in Xcode and name it WallpaperKit
In the project settings select the target and verify in Build Settings that Build Libraries for Distribution is Yes then set Skip Install to No
Create a new UIViewController subclass, name it WallpaperPreviewViewController, make it public, and add some functionality to it to show a UIImageView
Add a new Package Dependency in the project settings, for this example we’ll use https://github.com/onevcat/Kingfisher, and specify exact version 8.5.0
Add internal import Kingfisher and use it in WallpaperPreviewViewController to download and show an image from the web
Close the WallpaperKit project
Create Hosting App Project (this makes it easier to develop the framework functionality and test it in an app with Xcode building both in the same workspace)
Create a new iOS app project and name it WallpaperApp
Create a new workspace named WallpaperApp
Close the WallpaperApp project
Drag and drop WallpaperApp.xcodeproj into the workspace’s sidebar
Drag and drop WallpaperKit.xcodeproj into the workspace’s sidebar
Switch the scheme to WallpaperKit and build
Select WallpaperApp project, then with WallpaperApp target selected, in the General tab under Frameworks, Libraries, and Embedded Content, click + and add WallpaperKit.framework
In ViewController.swift, import WallpaperKit and add functionality to present an instance of WallpaperPreviewViewController
Run the app and verify it works
Create XCFramework
In Terminal, cd into WallpaperKit and run xcodebuild archive -scheme WallpaperKit -configuration Release -destination 'generic/platform=iOS' -archivePath './build/WallpaperKit.framework-iphoneos.xcarchive' SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES DEFINES_MODULE=YES
Run xcodebuild archive -scheme WallpaperKit -configuration Release -destination 'generic/platform=iOS Simulator' -archivePath './build/WallpaperKit.framework-iphonesimulator.xcarchive' SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES DEFINES_MODULE=YES
Run xcodebuild -create-xcframework -framework './build/WallpaperKit.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/WallpaperKit.framework' -framework './build/WallpaperKit.framework-iphoneos.xcarchive/Products/Library/Frameworks/WallpaperKit.framework' -output './build/WallpaperKit.xcframework'
Open the build folder and retrieve the XCFramework
Create Swift Package
Create a new package in Xcode, select Library, and name it WallpaperKitDist
Drag and drop WallpaperKit.xcframework into Sources
Create a new directory in Sources called WallpaperKitDependencies
Create a new Swift file in WallpaperKitDependencies called WallpaperKitDependencies (SPM requires a Swift file to recognize WallpaperKitDependencies as a valid target and fetch dependencies)
Open Package.swift and change it to
import PackageDescription
let package = Package(
name: "WallpaperKit",
platforms: [
.iOS(.v18)
],
products: [
.library(
name: "WallpaperKit",
targets: ["WallpaperKit", "WallpaperKitDependencies"]
),
],
dependencies: [
.package(
url: "https://github.com/onevcat/Kingfisher.git",
exact: "8.5.0"
)
],
targets: [
.binaryTarget(
name: "WallpaperKit",
path: "./Sources/WallpaperKit.xcframework"
),
.target(
name: "WallpaperKitDependencies",
dependencies: [
"Kingfisher"
],
path: "./Sources/WallpaperKitDependencies"
)
]
)
Create Test App (to simulate a third-party app using the package)
Create a new iOS app project and name it TestApp
Add a new Local package selecting the WallpaperKitDist directory that contains Package.swift
Import WallpaperKit and use it to present a WallpaperPreviewViewController
This works! Though the console logs
objc[39953]: Class _TtC10KingfisherP33_6AA794C9C370CDB07604B4D8B99AEAA312BundleFinder is implemented in both /Users/Name/Library/Developer/Xcode/DerivedData/TestApp-capvhjiqxrdgdnbevpkajicnjpcs/Build/Products/Debug-iphonesimulator/WallpaperKit.framework/WallpaperKit (0x100e8bbf8) and /Users/Name/Library/Developer/CoreSimulator/Devices/E0AF13C2-874C-47B9-B864-72AF3E4D5D4B/data/Containers/Bundle/Application/AF32011A-92E7-4E26-9A97-9F0C25C07863/TestApp.app/TestApp.debug.dylib (0x101a543b0). This may cause spurious casting failures and mysterious crashes. One of the duplicates must be removed or renamed.
I thought using internal import Kingfisher (or @_implementationOnly import Kingfisher) would have resolved this, but seems to make no difference compared to just import Kingfisher. I suspect it might not be an issue as long as the Kingfisher version number specified in the distribution Package.swift matches the version used in the framework project (and the app does not add a different version as a dependency), but not positive.
Can these warnings be resolved, or is it not a concern in this setup? Is this the best solution to distribute an XCFramework via Swift Package Manager that has dependencies on other Swift packages for now or is there a better approach? Thanks!
I keep getting "iOS 18.5 must be installed": dialoge box and when i try downloding 18.5 it fail Download failed.
Domain: DVTDownloadableErrorDomain
Code: 41
User Info: {
DVTErrorCreationDateKey = "2025-08-24 20:40:42 +0000";
}
Download failed.
Domain: DVTDownloadableErrorDomain
Code: 41
Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({
RequestedBuild = 22G86;
})
Domain: DVTDownloadsUtilitiesErrorDomain
Code: -1
Download failed due to a bad URL. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime)
Domain: com.apple.MobileAssetError.Download
Code: 49
User Info: {
checkConfiguration = 1;
}
System Information
macOS Version 15.5 (Build 24F74)
Xcode 16.4 (23792) (Build 16F6)
Timestamp: 2025-08-24T21:40:42+01:00
My app (called "MuVis - Music Visualizer") passes the macOS App Store verification, but is failing the iOS verification. The errors indicate a problem with the Swift package github.com/Treata11/CBass. I have been in touch with the CBass package developer (Treata11) as well as the original BASS developers (un4seen.com). We think the problem is related to CBass swift-package config (which apparently works fine for mac, but doesn’t for iOS). The source code for the package is at the site package. All of us think that the package is configured correctly in accordance with the latest Apple package development documentation. Please tell us what is wrong with this package, and how to make it pass the iOS App Store verification.
The Xcode error messages from validation testing include several items similar to:
Upload Symbols Failed: inline-code
The archive did not include a dSYM for the bass.framework with the UUIDs [18D5DBE2-3250-3EDE-B75C-D81B4E9F05AC, A88554A0-9087-3776-AC05-424B2D52F973, DEB682F5-ABBE-39D5-A0F8-8C01C14E178A]. Ensure that the archive's dSYM folder includes a DWARF file for bass.framework with the expected UUIDs.
Since the MuVis app is long and complex, I have written a minimal reproducible example app (called "SwiftCBassDemo") for which source code is available at DemoApp.
I am using macOS 15.6.1, Xcode 16.4, and iOS 18.6.2.
Hi everyone,
I’m building an iOS app that originally targeted iPhone using NavigationStack. Now I’m adapting it for iPad and switched to using NavigationSplitView to support a three-column layout.
The structure looks like this:
NavigationSplitView {
A // Sidebar
} content: {
B // Middle column – this shows a list
} detail: {
C // Detail view
}
The issue is with the list shown in view B (the content column). It appears completely unstyled, as if it’s using .listStyle(.plain) — with no background material, and a very flat look.
I can understand that this might be intentional on iPad to visually distinguish the three columns.
However, the problem is that this same unstyled list also appears on iPhone, even though iPhone only shows a single column view at a time!
I tried explicitly setting .listStyle(.insetGrouped) or .listStyle(.grouped) on the list in view B, but it makes no difference.
When I go back to NavigationStack, the list in B is styled properly, just as expected — but then I lose the enhanced iPad layout.
What I’m looking for:
I’d like to keep using NavigationSplitView, but I want the list in the content column (view B) to use the default iOS list styling, at least on iPhone.
Is there any way to achieve this?
Thanks!
My app uses VStack and HStack, instead of the normal table format. When I try to print everything works perfect but it will not print the cell outline.
What is the correct line code or instruction terminology?
Thanks, Hal
I have been learning from the Apple Developer tutorials and I got stuck on the ScoreKeeper chapter with Testing. Since my Macbook Pro 2017 can only use Xcode 15.2 as the highest level, I am having issues with it. I saw a forum post that a certain level of Swift and the tool chain would fix this. I attempted to install Swift 5.10.1 to then realize I only had Xcode 15.2 not 15.3, so I had to attempt to install Swift 5.9. Since neither option worked, I uninstalled Xcode and removed any extra files along with swift packages, minus my projects, to redownload and reinstall Xcode 15.2. Now I am having issues with building the scheme, and I get link error,s and they pertain to Swift 5.10.1, which I had not installed any Swift packages after the Xcode reinstallation. I have tried another previous project even a new one same error. This was 7/30/25, as of today 7/31 I tried to install Swift 5.9 thinking it would overwrite or "downgrade" the package, no such luck. The file path in the error stops at the /.../...RELEASE.pkg file and does not continue, which seems to be the issue of the error. How to I fix this issue, I had a working product 3 dyas ago