I have the following code:
extension AssetGridViewController: PHPhotoLibraryChangeObserver {
func photoLibraryDidChange(_ changeInstance: PHChange) {
Task { @MainActor in
guard let changes = changeInstance.changeDetails(for: fetchResult) else { return }
fetchResult = changes.fetchResultAfterChanges
}
}
}
With Swift 6, this generates a compilation error: Main actor-isolated instance method 'photoLibraryDidChange' cannot be used to satisfy nonisolated protocol requirement. The error includes to fix-it suggestions:
Adding nonisolated to the function (nonisolated func photoLibraryDidChange(_ changeInstance: PHChange))
Adding @preconcurrency to the protocol conformance (extension AssetGridViewController: @preconcurrency PHPhotoLibraryChangeObserver {)
Both options generate a runtime error: EXC_BREAKPOINT (code=1, subcode=0x105b7c400). For context, AssetGridViewController is a regular UIViewController.
Any ideas on how to fix this?
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Posts under Xcode tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I've updated my mac to Sequoia (MacOS 15) beta, my iPhone to iOS 18 beta, and Xcode to Xcode 16 beta.
Only then, I realized I couldn't publish app updates with Xcode beta (error in AppStore Connect). I tried using the non-beta Xcode version but got "Invalid Binary" during app review:
ITMS-90111: Unsupported SDK or Xcode version - App submissions must use the latest Xcode and SDK Release Candidates (RC). For details on currently supported versions, visit: https://developer.apple.com/news/releases.
I really need to publish updates and I can't wait for September. I can't downgrade my devices because that would require me to erase both my Mac and my iPhone (for testing), which is not something I can do.
Is there any option I didn't think about? How can I publish app updates in the current situation?
It really should be more explicit before updating that you can't release updates with the beta versions...
Xcode will build and analyze fine using the Debug build configuration but trying to use Analyze or Archive with Release configuration generates 3 errors: Undefined symbol: protocol conformance descriptor, Undefined symbol: type metadata accessor, and Undefined symbol: nominal type descriptor causing the linker to command to fail. The library is included and already linked and a previous version did not have the error so I think it's a code issue but not quite sure what it is or how to fix!
The project/package can be found here:
https://github.com/kudit/Device/tree/v2.1.17
(to reproduce, checkout this version and rename appending ".swiftpm" to the folder, then right-click to show package contents, open the Development folder and open the Xcode project there. It's done this way so the package can be imported and edited on iPad Swift Playgrounds)
I've created a closed source iOS SDK from a local Swift package, which has dependencies on other Swift packages, and successfully created a binary XCFramework following the solution from my previous post. I would now like to create a Package.swift to vend this XCFramework and test it in an example app to verify it works as expected before I upload it to a public repo for distribution.
I understand that binaryTarget does not support dependencies so we need to use a wrapper. I created a directory containing the following:
Package.swift
MyFramework.xcframework/
MyFrameworkWrapper/
├─ dummy.swift
Package.swift contains:
// 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: "MyFramework",
platforms: [
.iOS(.v14)
],
products: [
.library(
name: "MyFramework",
targets: ["MyFramework", "MyFrameworkWrapper"]
)
],
dependencies: [
.package(url: "https://github.com/gordontucker/FittedSheets.git", from: "2.6.1")
],
targets: [
.target(
name: "MyFrameworkWrapper",
dependencies: [
"FittedSheets"
],
path: "MyFrameworkWrapper"
),
.binaryTarget(
name: "MyFramework",
path: "MyFramework.xcframework"
)
]
)
I created a new iOS app, selected the project, Package Dependencies > + > Add Local, and added the directory containing this Package.swift. Xcode resolves the dependencies and lists them in the sidebar. I added code to import and use the framework. It builds successfully but the app crashes when run:
dyld[63959]: Library not loaded: @rpath/FittedSheets.framework/FittedSheets
Referenced from: <7DE247FC-DAFF-3946-AD21-E80F5AF841C9> /Users/Jordan/Library/Developer/Xcode/DerivedData/MyFramework-Example-gaeeymnqzenzrbbmhuebpodqctsz/Build/Products/Debug-iphonesimulator/MyFramework.framework/MyFramework
How do I get this working? I'm wondering is my package set up properly to vend the framework specifying its dependencies, and is my XCFramework created correctly?
The Package.swift for the framework's source code contains:
// 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: "MyFramework",
platforms: [
.iOS(.v14)
],
products: [
.library(
name: "MyFramework",
type: .dynamic,
targets: ["MyFramework"]
)
],
dependencies: [
.package(url: "https://github.com/gordontucker/FittedSheets.git", from: "2.6.1")
],
targets: [
.target(
name: "MyFramework",
dependencies: [
"FittedSheets"
],
path: "Sources"
)
]
)
And I created the XCFramework following the steps in that previous thread:
Create archive from package via xcodebuild archive -workspace "$PACKAGE_PATH" -scheme "$FRAMEWORK_NAME" -destination 'generic/platform=iOS' -archivePath "$ARCHIVE_PATH/iOS" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES ENABLE_USER_SCRIPT_SANDBOXING=NO ENABLE_MODULE_VERIFIER=NO OTHER_SWIFT_FLAGS=-no-verify-emitted-module-interface
Create the Modules directory in the framework via mkdir -p "$ARCHIVE_PATH/iOS.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework/Modules"
Copy the Swift interface files into the framework from the build in DerivedData via cp -a "$BUILD_PRODUCTS_PATH/Build/Intermediates.noindex/ArchiveIntermediates/$FRAMEWORK_NAME/BuildProductsPath/Release-iphoneos/$FRAMEWORK_NAME.swiftmodule" "$ARCHIVE_PATH/iOS.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework/Modules"
Repeat 1-3 for iOS Simulator
Create an XCFramework via xcodebuild -create-xcframework -framework "$ARCHIVE_PATH/iOS.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework" -framework "$ARCHIVE_PATH/iOS_Simulator.xcarchive/Products/usr/local/lib/$FRAMEWORK_NAME.framework" -output "$ARCHIVE_PATH/$FRAMEWORK_NAME.xcframework"
Prior Xcodes had a very useful function called "sort & unique" that was found under "services" in the contextual menu in the source editor. The new Xcode 16 betas seems to have had this removed, or perhaps it's been moved to a new menu. Does anyone know about this?
Thanks!
In my developper account, "Certificates, Identifiers & Profiles" show
two "Developer ID Installer" certificates (Expiration Date 2027/05/13 and 2027/02/01)
I did not found any way to delete, remove or revoke one.
How can I fix it ?
Xcode complaint "Command CodeSign failed with a nonzero exit code"
Previouly I put right this error with the command:
xattr -cr path_to_application
but this no longer work.
Hi, my Xcode is crashing immediately after clicking on 'Distribute' (after selecting 'Distribution Method', and regardless of the method I choose).
I've tried:
Updated Xcode
Cleared Derived Data
Updated macOS
Created new signing certificates
After all changes I created new archives but had the same result on distribute.
I recently cleaned up my mac, so I suspect I might've deleted something important. My touch bar also recently broke. Other than that, I can't think of any other variables since my last successful distribution attempt.
Please help, I've never experienced any issues like this.
I've attached snippets from the report as a text file, but the full report was too large:
xcode_crash_report.txt
I have created an archive for both iOS and MacOS versions of my app by doing the the following steps
Destinations select Build Any Mac (Mac Catalyst, arm64, x86_64)
Product > Archive
However when doing the same steps for VisionOS I get an error
Invalid Run Destination
I have selected both destinations, visionOS Simulator and Build any VisionOS simulator device (arm64, x86_64)
I am able to run the app and test, now I would like to upload to AppStoreConnect for TestFlight and App Store submission.
I've created a closed source iOS SDK from a local Swift package, which has dependencies on other Swift packages, and successfully created a binary XCFramework following the solution from my previous post.
Now I'm proceeding with the process to distribute this SDK. I believe I want to upload the XCFramework to a public repo alongside a Package.swift file and an Example app project that uses the XCFramework. So each time I go to create a new release I’ll create a new XCFramework replacing the current one, verify it's working properly in the example app, then commit, tag, and push to the repo.
My question is how do I set this up as a Swift package that includes an example app that uses the local XCFramework (not a remote url to a zip of the framework) and properly resolves dependencies?
So far I created a directory containing MyFramework.xcframework and Package.swift containing:
// 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: "MyFramework",
platforms: [
.iOS(.v14)
],
products: [
.library(
name: "MyFramework",
targets: ["MyFramework"]
)
],
dependencies: [
.package(url: "https://github.com/example/example.git", from: "1.0.0")
],
targets: [
.binaryTarget(
name: "MyFramework",
path: "MyFramework.xcframework"
)
]
)
I then created an Example iOS app project in that directory and now need to integrate the local XCFramework. I wondered if I could do that via File > Add Package Dependencies > Add Local, but when I navigate to that Package.swift and click Add Package it says
The selected package cannot be a direct ancestor of the project.
Do I need a different Package.swift for the Example app, and if so, how do I get that set up? I created a separate Package.swift (contents below) alongside the xcodeproj but when I try to add that in Xcode I get the same error, despite the fact this package is a sibling of the project not an ancestor.
// 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: "MyFramework-Example",
platforms: [
.iOS(.v14)
],
dependencies: [
.package(name: "MyFramework", path: "../")
],
targets: [
.target(
name: "MyFramework-Example",
dependencies: ["MyFramework"]
)
]
)
In other IDEs on many popular platforms, developers have the ability to analyze unreferenced header files in source code (either visually or thru warnings), like below:
// sourcefile.c
#include <file1.h>
// file2.h is not referenced in this source code file, so the following line would be grayed out in a well known iDE
#include <file2.h>
Is this possible in Xcode?
So I have 2 schemes: prod and staging. And both have their own Debug and Release configuration settings (one of which is the bundle ID, eg. prod-Release: com.mycomp.myApp, prod-Debug: com.myComp.myApp.debug, staging-Release: com.myComp.myApp.staging.debug, staging-Debug: com.myComp.myApp.staging.debug).
Now, there is a framework that is bound to each bundle ID. The framework is not from a So I need 4 instances of the same framework for each bundle ID. I tried separating the frameworks into folders and just link them whenever I need to run the appropriate scheme. Basically like so:
\{PROJECT_ROOT}\Frameworks\MyFramework\prod-Debug\MyFramework.xcframework
\{PROJECT_ROOT}\Frameworks\MyFramework\prod-Release\MyFramework.xcframework
\{PROJECT_ROOT}\Frameworks\MyFramework\staging-Debug\MyFramework.xcframework
\{PROJECT_ROOT}\Frameworks\MyFramework\staging-Release\MyFramework.xcframework
I've added a Run script to create the link before Compile Sources step like so:
cd "${SRCROOT}/zDefend"
if [ "${CONFIGURATION}" = "prod-Debug" ]; then
rm -rf ./MyFramework.xcframework
ln -s ./prod-Debug/MyFramework.xcframework MyFramework.xcframework
elif [ "${CONFIGURATION}" = "prod-Release" ]; then
rm -rf ./MyFramework.xcframework
ln -s ./prod-Release/MyFramework.xcframework/ MyFramework.xcframework
elif [ "${CONFIGURATION}" = "staging-Debug" ]; then
rm -rf ./MyFramework.xcframework
ln -s ./staging-Debug/MyFramework.xcframework MyFramework.xcframework
elif [ "${CONFIGURATION}" = "staging-Release" ]; then
rm -rf ./MyFramework.xcframework
ln -s ./staging-Release/MyFramework.xcframework/ MyFramework.xcframework
fi
I only have 1 target, myApp. But in the Build Settings, I set it so that every configurations will create 4 different binaries with 4 different bundle ID like I've mentioned above. I've added the framework by its link and set it to "Embed and Sign".
The framework itself is not from Cocoapods, Carthage or SwiftPM. We just need to compile it ourselves into 4 and bind them with their own bundle ID in the code. Then we manually added them into the project. It will throw error if the app's bundle ID is not the same with the bundle ID bound to the framework.
This can be compiled just fine. But when in created 2 or more binaries in the simulator, it crashes. So this is possibly a linking issue. How do I solve this?
Thank you.
I‘ve being trying to continue developing my own app for the last 4 weeks and I’ve not being able to do so due to this persistent error message whenever I try to deploy to my own device “Unable to verify app. Internet connection is required to verify trust.”
I’ve searched all around for a way to fix this issue but no body seems to be sure why this happens nor how to fix it.
It started happening right after I‘ve upgraded my phone from a 14 to a 15, and ever since, the 15 simply doesn’t allow me to deploy on it…
I also have a SE Gen 2 running iOS 15 and it seems to work just fine.
Anyone happens to know whats going on? Now I also have to worry if the iPhone is going to let me continue working or not whenever I upgrade it?
I was my understanding that you're supposed to be able to open a .ips crash log in Xcode and see pretty much what you would see if the app had been running in the debugger when it crashed. But the addresses in my app don't get symbolicated. I opened the .ips in the same project and same version of Xcode that was used to create the app. The .dSym file is around, and I can use it to symbolicate using the atos tool. What am I missing?
Hello, I'm a beginner and have started learning Swift. I want to create a toy CLI project that needs to read the arguments you pass to it, but I'm unable to figure out how I can run this project from the CLI so I can actually pass arguments to my program. Any idea?
Hello,
Im trying to create a sticker pack app. I have all the png in correct sizes however when running a simulation it does not show up.
objc[19306]: Class CKDetailsTUConversationCell is implemented in both /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/ChatKit.framework/ChatKit (0x7ff84276a840) and /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/Applications/MobileSMS.app/MobileSMS (0x103257b98). One of the two will be used. Which one is undefined.
mkdir: path=/var/mobile/tmp/com.apple.messages/ mode= -rwx------: [2: No such file or directory]
mkdir: path=/var/mobile/tmp/com.apple.messages/ mode= -rwx------: [2: No such file or directory]
setAllowableTypes_block_invoke:1242: *** CGImageSourceSetAllowableTypes - ignoring unknown: 'public.avci'
Received Connection Invalid
mkdir: path=/var/mobile/tmp/com.apple.messages/ mode= -rwx------: [2: No such file or directory]
Synchronous remote object got an error attempting to post setup, reason: Couldn’t communicate with a helper application.
[com.apple.MobileSMS:A5499A70-2351-4FAD-809D-DFD28B804635] Error when getting current app configuration for action identifier ConversationListFocusFilterAction, error='Error Domain=DNDErrorDomain Code=1007 "No current action is available. Supply the caller with the default." UserInfo={NSLocalizedDescription=No current action is available. Supply the caller with the default.}'
Calling -viewWillAppear: directly on a view controller is not supported, and may result in out-of-order callbacks and other inconsistent behavior. Use the -beginAppearanceTransition:animated: and -endAppearanceTransition APIs on UIViewController to manually drive appearance callbacks instead. Make a symbolic breakpoint at UIViewControllerAlertForAppearanceCallbackMisuse to catch this in the debugger. View controller: <CKSearchViewController: 0x10886a400>
XPC error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.coreduetd.knowledge was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.coreduetd.knowledge was invalidated: failed at lookup with error 3 - No such process.}
Invalid absolute dimension, must be > 0.0. NOTE: This will be a hard-assert soon, please update your call site.
Invalid absolute dimension, must be > 0.0. NOTE: This will be a hard-assert soon, please update your call site.
Invalid absolute dimension, must be > 0.0. NOTE: This will be a hard-assert soon, please update your call site.
Invalid absolute dimension, must be > 0.0. NOTE: This will be a hard-assert soon, please update your call site.
Duet query failed: Couldn’t communicate with a helper application.
Synchronous remote object got an error attempting to post setup, reason: Couldn’t communicate with a helper application.
UIColor created with component values far outside the expected range. Set a breakpoint on UIColorBreakForOutOfRangeColorComponents to debug. This message will only be logged once.
Error registering for delegate callbacks. Error: Error Domain=SKStatusSubscriptionErrorDomain Code=-4000 "System iCloud account does not exist or is not statuskit capable" UserInfo={NSDebugDescription=System iCloud account does not exist or is not statuskit capable}
Error retrieving subscription for handle. Error: Error Domain=SKStatusSubscriptionErrorDomain Code=-4000 "System iCloud account does not exist or is not statuskit capable" UserInfo={NSDebugDescription=System iCloud account does not exist or is not statuskit capable} handle: <SKHandle: 0x600000005df0; handleString = "+18885551212">
Error fetching subscription service for handle: "+18885551212" Error: Error Domain=SKStatusSubscriptionErrorDomain Code=-4000 "System iCloud account does not exist or is not statuskit capable" UserInfo={NSDebugDescription=System iCloud account does not exist or is not statuskit capable}
Checked bag access permission -- allowed? YES {hasMachAccess: YES, hasEntitlements: YES}
failed to create XPC connection
Unknown invokeXPCSynchronousCallWithBlock error: Error Domain=TransparencyErrorXPC Code=-108 "failed to create XPC connection" UserInfo={NSLocalizedDescription=failed to create XPC connection}
API MISUSE: Resuming an NSURLSessionTask with nil URL.
Task .<1> finished with error [-1002] Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSUnderlyingError=0x600000c93720 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask .<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask .<1>"
), NSLocalizedDescription=unsupported URL}
Requested keyboard snapshot but UIKeyboard.usesInputSystemUI returned NO.
Failed to get pid info for pid 0: Operation not permitted
Remote app card controller com.apple.messages.MSMessageExtensionBalloonPlugin:0000000000:com.apple.Stickers.UserGenerated.MessagesExtension timed out during delayed presentation
Failed to get pid info for pid 0: Operation not permitted
unhandled process MobileSMS
I have an app that runs on both iOS and visionOS (native). Both app use the same project, just some files and code segments are different. We do not use automatic signing. Instead we use a Distribution profile. When creating a distribution profile and adding capabilities there are certain capabilities we are using on iOS that are not available on visionOS. Like the com.apple.developer.kernel.increased-memory-limit and the Extended Virtual Addressing Entitlement. My understanding is that we can only have one Distribution profile per app (may be wrong understanding). My question is how can we have two separate distribution profiles for iOS and visionOS, so iOS can have those extra capabilities that aren't available on visionOS?
I tried to create two separate targets, one for iOS and one for visionOS, but that still gives me the same issue of having the distribution profile being the same and not being able to make it unique for iOS and visionOS. Is there a correct approach to setting up the Xcode project or the distribution profile?
I'm new to visionOS development and distribution profiles, any guidance would be appreciated. Let me know if you have any questions or need more clarification.
We have a Privileged Helper tool that we install with SMJobBless. I would like to debug it.
I've added WaitForDebugger in our helper tool launchd plist and it does wait.
But I can't attach to it via Debug->Attach to Process in Xcode with error:
Code: 3
Failure Reason: tried to attach to process as user 'myusername' and process is running as user 'root'
I set Debug process as: root in scheme settings. But I'm not sure if it does anything since I'm not running this particular scheme at the moment of attach.
I tried unsuccessfully to set "Wait for the executable to be launched" but I had to create a new scheme for it since helper is built as part of the main app so maybe I did something wrong.
Am I doing something wrong or is it not possible to attach to root process?
Greetings to all!
I recently developed an called DANZUB, the hub for dancers using the Adalo no-code tool. The App from adalo was directly imported into TestFlight on App Store Connect. When I released it for review, I got a rejection that app was not supported (display scale issue) on Ipad. I have primarily designed for IPhones and I do not know how I can adjust to IPads as well. I don't have this option on Adalo.
Some said I could change the settings in XCode. But I don;t have the file, because the file was directly exported from Adalo to App Store Connect. I am unable to download the file.
Please help, I am new to developing. So close yet so far. Thanks all!!
I am having problems building an Unreal project in Xcode.
The problem starts when the compiler starts to build a custom made plugin, that works perfectly fine on windows.
When looking at the log, it seems that I will have to rebuild the plugin for macOS-arm64, does anyone have some ideas how I should approach?
Showing All Messages
------ Building 4 action(s) started ------
[1/4] Link [Apple] Trancendent
Undefined symbols for architecture arm64:
"ExampleLibraryFunction()", referenced from:
FTrancendantMetaNodesModule::StartupModule() in Module.TrancendantMetaNodes.cpp.o
ld: symbol(s) not found for architecture arm64
/Users/Shared/Epic Games/UE_5.3/ld:1:1: ignoring file /Users/nicolaslefevre/Desktop/KanuziTemple/Plugins/TrancendantMetaNodes/Source/ThirdParty/TrancendantMetaNodesLibrary/Mac/Release/libExampleLibrary.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Total time in Parallel executor: 2.18 seconds
Total execution time: 2.95 seconds
/Users/Shared/Epic Games/UE_5.3/clang:1:1: linker command failed with exit code 1 (use -v to see invocation)
The connection to service named com.apple.testmanagerd was invalidated: failed at lookup with error 3 - No such process.
Currently I am struggling with this problem while running tests runner
`xcrun devicectl device process launch --console --device '000000000000000000000' 'com.gl.RunnerPOC-Watch-AppUITests.xctrunner
What may be causing the issue?
Thanks in advance