I'm getting a filed to diagnose for expression; submit a bug report (http://swift.org
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Post
Replies
Boosts
Views
Activity
Cannot select individual view in selectable mode in Xcode preview, it only show the whole blue device border.
I'm getting Sandbox:rsync.samba deny errors trying to build an app using Xcode 16 betas.
There's lots of info on this on google, and the solution everybody used to fix it is to change the Xcode build setting User Script Sandboxing from NO to YES.
However this doesn't exist with Xcode 16. Does it have a replacement?
Hi,
I'm looking for help on how to troubleshoot. I will probably file a bug report, but I wonder if it's Xcode or Swift, and I would like to put some more data than I currently have.
With Xcode 16 beta 2, the "planning swift module" stage of one of the modules often takes several minutes (between 280 and 300 seconds). Normally it takes a few seconds. The other modules take less than a second.
I have a workspace, containing a project and 3 local swift packages. My project contains one iOS app target, 1 framework target (a dependency of the app), and several test targets. The faulty module is the app module.
We are facing problems with the following setup:
USB-Keyboard is connected to an iPhone and an iPad on the lightning port.
Once connected the onscreen keyboard doesn't show up any longer.
Is there a way to enable the onscreen keyboard together with a USB-connected keyboard?
Anything we can do in the code to get the onscreen keyboard to be shown again?
Hi
I am stuck to work with Reality Composer Pro with Xcode.
When I made an anchor component for detecting surface to USDZ file and save to Reality Composer Pro project. and try to see in my iPhone. but keeps got error like follow.
Building for 'iphoneos', but realitytool only supports [xros, xrsimulator]
How can I correctly bring my Reality Composer Pro project to Xcode to see in my iPhone? I tried to find but can't see step by step explain.
thanks
Xcode 16 beta2;
macOS Sequoia Developer Beta;
iMac 2019 Intel i5;
My app runs fine in Xcode15. but after upgrade to Xcode16 it will crash when I run it.
At first it crash in com.apple.CoreMotion.MotionThread, so I delete the code about CMMotionManager.
but it crashed again.
Xcode15 seems can't run in macOS Sequoia. Should I back to macOS Sonoma?
I created package.swift for my framework. And was work correctly in iOS. Now we need to support tvOS. I don't understood how can we do it. Because source code is different but networking layer is same.
When I create dynamic targets:
extension Target{
static func allTargets() -> [Target]{
return ([
Target.SDKTarget(),
] as [[Target]]).flatMap{$0}
}
static func SDKTarget() -> [Target] {
#if os(tvOS)
return [
.target(name: frameworkName,
dependencies: [
.product(name: "GRPC", package: "grpc-swift"),
],
path: "Sources/tvOS",
)
]
#else
and when I select tvOS build this code in preprocessor block still gray and won't compile.
How to make single package.swift for my framework for support tvOS and iOS with different code base and shared networking source code?
Hello everyone,
I'm currently developing an application that involves network communication on an Apple Watch.
I'm using Apple's network framework for communication and for validation purpose I need to establish communication between an Apple Watch simulator and an external command-line tool (nc). To send the connection requests, I require the IP address of the Apple Watch simulator.
I've been unable to locate the IP address of the Apple Watch simulator after searching is settings everywhere. This IP address is required for setting up network requests and ensuring effective testing and integration of Apple's network framework.
Could someone please provide guidance on how to obtain the IP address of the Apple Watch simulator? Specifically, I need to know how to retrieve this IP address so that I can configure my external command-line application (nc) to send connection requests to the simulator.
Thank you for your assistance and insights!
Regards,
Harshal.
I have noticed that every time I open a new file (by clicking, double-clicking, or using "open quickly"), instead of opening in a new tab, there is a chance that it will replace my current tab with the new file.
For example, if I have 3 files open, my tabs look like this:
[a.swift, b.swift, c.swift]
and b.swift is my current working file. When I open d.swift, my tabs then become:
[a.swift, d.swift, c.swift]
How can I change this behavior?
I am trying to install the command line tools for Xcode. When I open the installer, it says
Command line tools can't be installed on this disk.
macOS version 14 or later is required
However, About This Mac says that I am running Catalina 1015.7. If I try to install Xcode from the App Store I get the same message.
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!
import AVFoundation
Button {
let utterance = AVSpeechUtterance(string: "Hello world")
utterance.voice = AVSpeechSynthesisVoice(language: "en-GB")
utterance.rate = 1
let synthesizer = AVSpeechSynthesizer()
synthesizer.speak(utterance)
} label: {
Text("hello")
}
i omitted some code but this is the core part. When i run this on apple watch se 2 simulator (watch os 10.5) nothing happens and gives the error
Query for com.apple.MobileAsset.VoiceServicesVocalizerVoice failed: 2
Unable to list voice folder
Query for com.apple.MobileAsset.VoiceServices.GryphonVoice failed: 2
Unable to list voice folder
Query for com.apple.MobileAsset.VoiceServices.CustomVoice failed: 2
Unable to list voice folder
Query for com.apple.MobileAsset.VoiceServices.GryphonVoice failed: 2
Unable to list voice folder
The 2024 WWDC video 'Meet FinanceKit' has a code example to get the latest 7 AccountBalance entries for a given account:
// Get latest 7 available balances for account
func getBalances(account: Account) async throws -> [AccountBalance] {
let sortDescriptor = SortDescriptor(\AccountBalance.asOfDate, order: .reverse)
let predicate = #Predicate<AccountBalance> { balance in
balance.available != nil &&
balance.accountId == account.id
}
let query = AccountBalanceQuery(
sortDescriptors: [sortDescriptor],
predicate: predicate,
limit: 7
)
return try await store.accountBalances(query: query).reversed()
}
This code does not compile, because the AccountBalance struct has no field named asOfDate - you need to inspect the currentBalance enum, switch over the enum type value, and then extract asOfDate from the associated value.
All of this can't be done in a KeyPath (as far as I know 🤷♂️), which I think means it's impossible to get recent balances, without specifying a date, or getting all balances, and then sorting them in memory.
Am I missing something? I'd love to be proven wrong :)
FB14076698
XCode 16 beta1 and beta2 hangs whenever I try to open Localizable.xcstrings. The localization screen appears but afterwards XCode becomes unresponsive until I kill it. To make matters worse, upon restart the last window, Localizaton is reloaded, instantly causing a hang again (I need to be super quick as I have about half a second to try to click elsewhere like crazy). The same localization strings file works fine on XCode 15.4.
I tried to export all localizations in 15.4, empty the file, re-generate localization strings, re-import languages one by one in 16, starting with different languages (thinking maybe a weird exotic character causes the issue with one of the languages, this happened previously crashing XCode 15 until I found the offending character and replaced it with something else). But generally even after just adding a single language there is a serious slowdown - after adding the second one, XCode hangs again.
Note: the app in question has a lot of localizable strings - I had no issue creating a simple project with only a few strings. Just hoping a fix - I really wished the issue was fixed in beta2 but now I am a bit concerned that maybe it's a rare problem and might not get fixed as I saw no similar reports so far.
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
After updating Xcode to beta 2 the predictive code completion disappeared.
Does anyone know if it is possible to re-enable it somehow?
MacOS Version: 15.0 Beta 2 (24A5279h)
Xcode Version: 16.0 beta 2 (16A5171r)