Build, test, and submit your app using Xcode, Apple's integrated development environment.

Posts under Xcode tag

201 Posts

Post

Replies

Boosts

Views

Activity

Resolving a "Simulator runtime is not available" error
Some Macs recently received a macOS system update which disabled the simulator runtimes used by Xcode 15, including the simulators for iOS, tvOS, watchOS, and visionOS. If your Mac received this update, you will receive the following error message and will be unable to use the simulator: The com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime is not available. Domain: com.apple.CoreSimulator.SimError Code: 401 Failure Reason: runtime profile not found using "System" match policy Recovery Suggestion: Download the com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime from the Xcode To resume using the simulator, please reboot your Mac. After rebooting, check Xcode Preferences → Platforms to ensure that the simulator runtime you would like to use is still installed. If it is missing, use the Get button to download it again. The Xcode 15.3 Release Notes are also updated with this information.
0
0
8.7k
May ’24
Xcode_26 not compiling Metal project
Hello Xcode 26.0.1 (17A400) Missing some Metal components When building a program using Metal, it induces an unexpected error : “error: error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain Command CompileMetalFile failed with a nonzero exit code” Which terminates the build The fix given “xcodebuild -downloadComponent MetalToolchain” using sudo does not work Did someone find a work around or could resolve the issue? Many thanks Jean MacBook Air M4; macOS 26.0.1; Xcode 26.0.1
0
0
34
7h
Issue with StoreKit 2 Purchases: "unfinalized statements / unfinished backups" SQLite Crash
Hi, I’m running into a persistent error while implementing StoreKit 2 renewable subscriptions in my SwiftUI app. Context I have a two-screen flow: Screen 1: user selects a subscription plan (monthly / yearly). Screen 2: user fills out personal information and taps Subscribe that triggers the purchase function. On first launch or the first couple of purchases (on both Storekit's local and Sandbox testing), everything works fine. The App Store popup appears, the purchase goes through, and I get the transaction result. But after a few runs (3rd or 4th purchase attempt onward), my app crashes the moment the App Store purchase popup appears. Error Logs When the crash happens, the console shows: `unable to close due to unfinalized statements or unfinished backups BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: /private/var/mobile/Containers/Data/Application/D8D97A11-DF06-4EF2-AC55-138C4739A167/Library/d6d2e85a60f0480c4c17834eeb827a14_MPDB.sqlite invalidated open fd: 21 (0x11) BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: ...` Observations The error only shows after some time maybe due to multiple transactions and switching between plans for the same user, not on the very first purchases. If I land on the purchase screen immediately after app launch, the purchase works. But if I wait a while before navigating to the purchase screen, the popup causes the app to crash. I’m not using Core Data or my own SQLite database at all - so I assume this DB (MPDB.sqlite) is StoreKit’s internal persistence. Things I’ve tried so far Cleaning StoreKit caches: rm -rf ~/Library/Developer/CoreSimulator/Devices/*/data/Container s/Data/Application/*/Library/Caches/storekit Rebuilding from scratch, cleaning build folder. Switching between sandbox accounts, signing out/in again. Added await transaction.finish() after verified purchases. Added cleanup for unfinished transactions at app launch: for await result in Transaction.unfinished { if case .verified(let transaction) = result { await transaction.finish() } } Tried both StoreKit Configuration file and sandbox environment but issue persists in both. Questions Is this error StoreKit-specific (internal SQLite DB corruption) or something wrong in my implementation? Why would it only appear after a few runs / with a delay before navigating to the purchase screen? Am I missing something else in handling StoreKit 2 transactions? Screenshots of the errors are attached for context. Any insights would be really appreciated...I’m stuck because I can’t tell if this is an Apple bug with StoreKit 2 or something I’ve overlooked in my code. Specs: Xcode 16.4 Build version 16F6 iOS version: 18.6.2
1
0
30
20h
Xcode Code coverage shows zero; even after 245 successful tests
I have a project inside the project structure. I have around 300 unit tests in the project. I see that for some of the subprojects, the coverage numbers show up correctly, but for other subprojects and the main project, the coverage number shows zero, even though the tests are running successfully. The log I get is: Aggregation tool emitted warnings: warning: /Users/ABC/Library/Developer/Xcode/DerivedData/projectABC-hfzmkbdgpiswoxfvvnvhrafaiqyb/Build/ProfileData/A8EEC1FB-1699-4C29-A88C-D3DDA226DBC0/0A416494-A393-4319-AA47-502D72084C9C-43351.profraw: raw profile version mismatch: Profile uses raw profile format version = 8; expected version = 10 PLEASE update this tool to the version in the raw profile, or regenerate the raw profile with the expected version. I only have one Xcode (26.0.1) on my machine. I tried cleaning the derived data, the cleaning project, and rerunning the tests, but it hasn't helped. Please help me get the coverage number back. Thank you.
0
0
34
1d
XIB Files line seperator = none not be respected in iOS 26.1 ONLY
Hey All, Curious if you guys are seeing the same thing for those who are using Interface Builder Files (Xib) i set the line seperator to none and on my app (built against ios 18 on the app store, but doesnt matter if i build it against ios 26, or ios 26.1) when running on iOS 26.1 the line seperator will show even when i set it to None. Funny enough if i just play around with the XIB file and set it to single line and maybe RED color the IB file will show it but when running it its the same old default dark greyish color. BUT if i set the line seperator in CODE either to be none or with single line + red it looks good when running on sim / device. So it seems to be an issue with XIB files not being respected in iOS 26.1 (only) i have submitted a feed back FB20466783, hope this helps any xcode devs / uikit devs. thank you !
1
0
67
1d
"Build input file cannot be found" error occurs in Archive.
"Build input file cannot be found" error occurs in Archive. When running Archive to generate a build file, the build file generation fails with a "Build input file cannot be found: ..." error. When debugging, the build runs fine on the actual device without any errors. Comparing and modifying the Build Settings with other projects doesn't fix the issue. Deleting the Swift file and attempting to Archive results in a crash due to the missing file. Even after deleting and adding the Swift file, the same error persists when attempting to Archive. Even after deleting and re-adding the Swift file, the issue persists even after deleting all DerivedData file space on my Mac and restarting Xcode. Can you help me with this issue? It worked fine before the recent macOS update, and I successfully archived and published it to the App Store a few days ago. I believe this issue occurred after updating macOS to 26.0.1. My Xcode version is 26.0.1.
1
0
41
21h
Embed/Do Not Embed & Mach-O type
My Xcode project has the following configuration: 1 iOS app target 1 Xcode framework target (mach-o-type "Dynamic Library") 5 static libraries Dependencies: All the static libraries are target dependencies of the framework. The framework is the only target dependency of the iOS app. For the iOS app target, within the General tab > Frameworks, Libraries & Embedded content, I've set the framework as "Do not embed" So now I have a dynamic framework which won't be copied to the .app bundle in the build output. As per my understanding, this should result in a runtime error, dyld should not be able to find the framework files as they were not embedded in the final .app bundle. But regardless, my app runs without any errors, using all the methods exposed by the framework. What is the correct understanding here? What exactly does Embed/Do not embed mean (apart from excluding the files from .app bundle) When both settings are specified, is there any priority or precedence of one setting over the other?
2
0
83
8h
Xcode 26.0 unknown type name 'sqlite3_context'
I have been using the Mixpanel-Swift SDK alongside the Salesforce Mobile SDK in my iOS project with Xcode 16.4 without any issues. However, after upgrading to Xcode 26, I started encountering a problem related to SQLite3. Here is the relevant portion of my Podfile setup: platform :ios, '17.0' def required_pods source 'https://cdn.cocoapods.org/' source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git' use_frameworks! pod 'SalesforceAnalytics', '13.0.2' pod 'MobileSync', '13.0.2' pod 'SalesforceSDKCore', '13.0.2' pod 'SalesforceSDKCommon', '13.0.2' pod 'SmartStore', '13.0.2' pod 'Mixpanel-swift' end target 'Test' do required_pods end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = "" config.build_settings['CODE_SIGNING_REQUIRED'] = "NO" config.build_settings['CODE_SIGNING_ALLOWED'] = "NO" config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '17.0' end end end Has anyone else encountered a similar issue or discovered a workaround? Any advice or solutions would be greatly appreciated. Thank you in advance!
1
0
110
20h
Xcode 26 gets stuck frequently
Hi, Ever since I updated to macOS Tahoe and started using Xcode 26 daily, I've run into an issue where it gets stuck very frequently when launching and running my app in the simulator. It happens with the main app target as well as when running unit tests. If I restart Xcode and the simulator app, it works fine again for a while, but after some use, it goes back to the same situation. In Activity Monitor, Xcode ends up at 1000% CPU utilization for a minute or more, basically rendering the simulator and the debugger stuck. If I untick the "Debug Executable" option in the scheme editor, it works fine as well. Anyone else run into the same situation, or are there any tips I can follow to fix this issue? It makes it really tedious to make changes and then be stalled for a minute or more to see the app run. I've restarted the Mac, erased the booted simulator as well. I'm on a MacBook Pro M4 Pro. Everything used to run fine before macOS Tahoe / Xcode 26 on my main device. In fact, I used to run macOS Tahoe / Xcode 26 beta versions on a separate partition without any problems.
0
0
65
1d
xcodebuild -exportLocalizations Fails Due to Cross-Platform Dependencies
I'm working on a large multi-platform iOS project (iOS, iPadOS, watchOS, tvOS, visionOS) and have successfully migrated from legacy .strings files to modern String Catalogs (.xcstrings). However, I'm unable to export localizations using xcodebuild -exportLocalizations due to cross-platform framework dependency issues. (Note: I did have AI help me write this question, so apologies in advance for any errors) Project Structure Main iOS/iPad app with multiple extensions watchOS companion app tvOS app visionOS app 49 .xcstrings files successfully migrated across all targets Uses Swift Package Manager for modularization The Problem When attempting to export localizations using xcodebuild -exportLocalizations, the build fails because it tries to build all targets across all platforms, including watchOS targets that depend on third-party xcframeworks that don't include watchOS slices: xcodebuild -exportLocalizations \ -project MyProject.xcodeproj \ -scheme MyApp \ -localizationPath ./export \ -configuration Debug Error: error: While building for watchOS, no library for this platform was found in 'Frameworks/<incompatible>.xcframework'. (in target 'Target') These frameworks cannot be modified to add watchOS support (third-party/legacy dependencies). What Works vs. What Doesn't Works: Building the iOS app through Xcode GUI Fails: Exporting localizations through Xcode GUI (Product → Export Localizations...) Fails: xcodebuild -exportLocalizations with any combination of flags Attempted Solutions (All Failed) Platform-specific destination: xcodebuild -exportLocalizations -destination "generic/platform=iOS" ... SDK constraint: xcodebuild -exportLocalizations -sdk iphoneos ... Excluding architectures: xcodebuild -exportLocalizations EXCLUDED_ARCHS="armv7k arm64_32" ... Build first, then export: xcodebuild build -scheme MyApp -sdk iphoneos && \ xcodebuild -exportLocalizations ... All approaches still attempt to build watchOS targets despite platform constraints. Observations The -exportLocalizations flag appears to ignore -destination and -sdk flags It seems to scan and build ALL schemes/targets in the project regardless of constraints Regular builds (xcodebuild build) work fine with platform constraints Current Workaround I created a Python script that parses .xcstrings JSON files directly and generates XLIFF output, which works but feels like it's bypassing Apple's intended workflow. Questions for Apple Is there a way to limit xcodebuild -exportLocalizations to specific platforms? The documentation doesn't mention any flags for this, and -destination/-sdk appear to be ignored. Why does -exportLocalizations require building ALL targets across ALL platforms? Both the Xcode GUI (Product → Export Localizations) and xcodebuild -exportLocalizations fail with identical build errors, suggesting this is by design. Is there a reason localization export can't be limited to buildable targets? Is the intended workflow to have ALL targets buildable across ALL platforms before exporting localizations? This seems impractical for multi-platform projects with platform-specific dependencies. Are there any build settings or configuration options that can exclude specific targets/platforms from the localization export scan? Is directly parsing .xcstrings files and generating XLIFF an acceptable alternative, or does this miss important metadata that -exportLocalizations would include? Environment Xcode 16.x / 26.x (reproduces on both) macOS Tahoe Project uses String Catalogs (.xcstrings) format Mixed SPM packages and traditional target structure Any guidance on the correct approach for multi-platform localization export would be greatly appreciated. Is this a known limitation, or is there a recommended pattern I'm missing?
2
0
113
22h
iOS 26 Voice Over is reporting an extra tab
Feedback number: FB20451665 When building with Xcode 26, Voice Over is reporting an extra tab when swiping through tabs. Please see the sample project below: /* This is a Sample project to show that I believe there is a Voice Over bug in iOS 26. When swiping through tabs with Voice Over active, there always appears to be an extra tab. Here I have 5 tabs, when on tab one VO reads out tab 1 of 6, then tab 2 of 6, all the way to the last tab, when voice over reads out tab 5 of 6. Never tab 6 of 6. Is there a possibility that voice over is picking up the underlying `more` tab and reading that out? This has also been reportedly found in the Files app here: https://www.applevis.com/comment/195441#comment-195441 */ struct ContentView: View { var body: some View { TabView { /// Activating this has Voice over telling us there are 6 Tabs. Tab(RootTab.home.title, systemImage: "circle.fill") { Text("This is the \(RootTab.home.title.capitalized) screen") } .accessibilityLabel("\(RootTab.home.title.capitalized) tab") .accessibilityHint("Double tap to open the \(RootTab.home.title.capitalized) tab") Tab(RootTab.diary.title, systemImage: "circle.fill") { Text("This is the \(RootTab.diary.title.capitalized) screen") } .accessibilityLabel("\(RootTab.diary.title.capitalized) tab") .accessibilityHint("Double tap to open the \(RootTab.diary.title.capitalized) tab") Tab(RootTab.meals.title, systemImage: "circle.fill") { Text("This is the \(RootTab.meals.title.capitalized) screen") } .accessibilityLabel("\(RootTab.meals.title.capitalized) tab") .accessibilityHint("Double tap to open the \(RootTab.meals.title.capitalized) tab") Tab(RootTab.knowledge.title, systemImage: "circle.fill") { Text("This is the \(RootTab.knowledge.title.capitalized) screen") } .accessibilityLabel("\(RootTab.knowledge.title.capitalized) tab") .accessibilityHint("Double tap to open the \(RootTab.knowledge.title.capitalized) tab") Tab(RootTab.profile.title, systemImage: "circle.fill") { Text("This is the \(RootTab.profile.title.capitalized) screen") } .accessibilityLabel("\(RootTab.profile.title.capitalized) tab") .accessibilityHint("Double tap to open the \(RootTab.profile.title.capitalized) tab") /// Activating this also has Voice over telling us there are 6 Tabs. // ForEach(RootTab.allCases, id: \.self) { tab in // // Text("This is the \(tab.title.capitalized) screen") // .tabItem { // Label(tab.title.capitalized, systemImage: "circle.fill") // } // .accessibilityLabel("\(tab.title.capitalized) tab") // .accessibilityHint("Double tap to open the \(tab.title.capitalized) tab") // } } } enum RootTab: CaseIterable { case home case diary case meals case knowledge case profile var title: String { switch self { case .home: "home" case .diary: "diary" case .meals: "meals" case .knowledge: "knowledge" case .profile: "profile" } } } } I'm curious if anyone else can see this issue, or if anyone knows of a workaround for it.
1
0
362
2d
Xcode shows alert about unknown com.apple.quicklook.preview extension point when running on Apple Vision Pro Simulator
I have an iOS app with a QuickLook extension. I also added Apple Vision Pro in the target's General > Supported Destinations section. About one year ago, I was able to run the app on iPhone, iPad and Apple Vision Pro Simulators. Today I tried running it again on Apple Vision Pro with Xcode 26.0.1, but Xcode shows this error: Try again later. Appex bundle at ~/Library/Developer/CoreSimulator/Devices/F6B3CCA8-82FA-485F-A306-CF85FF589096/data/Library/Caches/com.apple.mobile.installd.staging/temp.PWLT59/extracted/problem.app/PlugIns/problemQuickLook.appex with id org.example.problem.problemQuickLook specifies a value (com.apple.quicklook.preview) for the NSExtensionPointIdentifier key in the NSExtension dictionary in its Info.plist that does not correspond to a known extension point. I tried again later a couple times, even after running Clean Build Folder Immediately, without any change. I can reproduce this with a fresh Xcode project to which I add a Quick Look Preview Extension and Apple Vision Pro as a supported destination. The error doesn't happen when running on Apple Vision Pro (Designed for iPad) or iPad Pro 13-inch (M4) destinations. What is the problem? I created FB20448815.
0
0
12
2d
preferredImageDynamicRange is not marked as being available only for iOS 17 and above.
open var isAnimating: Bool { get } /// The preferred treatment to use for HDR images. By default the image view will defer to the value from its traitCollection. open var preferredImageDynamicRange: UIImage.DynamicRange /// The resolved treatment to use for HDR images. open var imageDynamicRange: UIImage.DynamicRange { get } This attribute is not marked as being applicable only in iOS 17+ versions. When viewing the UIImageView code in Xcode, the @available(iOS 17.0, *) annotation was not added, which resulted in successful compilation but caused a crash on iOS 16 devices.
3
0
72
2d
UIStepper can't reach min/max value
When I build my project with Xcode 26 the following code makes the stepper decrement option disabled: stepper.stepValue = 0.5 stepper.value = 1.0 stepper.minimumValue = 0.7 stepper.maximumValue = 4.0 I think the reason for this is that the (value - stepValue) goes bellow the minimumValue. But on all iOS versions before iOS 26 this made the decrement option enabled and it clamped the value to the minimumValue. The same issue can be reproduced for the maximumValue. Does anyone else have the same issue? Do we need to adjust the stepValue based on the current value?
1
0
58
3d
Unable to launch any simulators in Xcode, XPC error talking to liblaunch_sim.dylib could not be opened
Hello, been beating my head against the wall for a few days with this. Originally got the error in Xcode 16, through the course of troubleshooting uninstalled and reinstalled Xcode multiple times, upgraded Xcode to 23 - same result. Create a different user on my computer and try, same result. Xcode &gt; Settings &gt; Components show both iOS 26.0 and iOS18.6 simulator, however no simulators show in Xcode, and Xcode hangs when you try to create one. 'xcrun simctl list runtimes' shows this: iOS 18.6 (18.6 - 22G86) - com.apple.CoreSimulator.SimRuntime.iOS-18-6 (unavailable, liblaunch_sim.dylib could not be opened) iOS 26.0 (26.0 - 23A343) - com.apple.CoreSimulator.SimRuntime.iOS-26-0 (unavailable, liblaunch_sim.dylib could not be opened). Does anyone have any ideas on what the issue could be?
0
0
163
3d
macOS 26.0 Tahoe + Xcode 26.0.1 Simulator causes system-wide audio distortion
After upgrading to macOS 26.0 Tahoe and Xcode 26.0.1, I’ve noticed an issue with audio playback whenever the iOS Simulator is running. Device: MacBook Pro 13" (2020, Intel, 16GB RAM, 500GB SSD) Issue: Any sound played on the Mac (system sounds, music, videos) begins to break/distort once the Simulator is active. App Sounds: If the app running inside the Simulator plays audio, that audio also breaks/distorts. Previous Version: This issue did not occur on macOS Sequoia 15 or with Xcode 16. Everything was working fine before the upgrade.
1
1
111
3d
Long loading time when showing/hiding the Code Review window in Xcode 26.0.1
When showing or hiding the Code Review window in Xcode 26.0.1, a loading screen appears and Xcode freezes. The loading screen appears for about 30 seconds, then disappears and the Code Review window appears. During this time, Xcode also freezes and cannot function. It doesn't seem to be an error or bug, but people who frequently switch between Code Review windows find the long loading time inconvenient. Is there any way to improve this? (MacBook Pro 16, M2 Max, 64GB memory, macOS 26.0 (25A354))
0
0
97
5d
Xcode 26 Debug Error Display Issue
I recently installed Xcode 26.0.1. (MacBook Pro 16, M2 Max, 64GB memory, macOS 26.0 (25A354)) Normally, when debugging, a red error appears in the left-hand Issues navigation, and you can click on it to access the location of the error. However, currently, when debugging, the red error does not appear in the "Issue Navigation" on the left-hand side of the Xcode screen. There is an error, but it isn't displayed. It does appear, but disappears after 1 second. (It disappears before I can click on it.) The error doesn't appear or disappears after 1 second, so I can't pinpoint the exact location. Please help me resolve this issue. Additionally, I deleted all Xcode development-related files inside my Mac and restarted my MacBook, but the symptom still persists.
3
0
128
5d
Issue in distributint my app on TestFlight.
Hi, yesterday when I was trying to release the TestFlight build of my app the xcode said that it could not authenticate my apple ID. I then came to know that it actually wanted me to complete and aggrement which was "Paid Apps Agreement". This agreeemnet is to be made if one has to sell their app on AppStore or make in-app-purchases. I want to ask if it was mandatory for me to sign that agreement? As the solution which I could come across suggested that xcode blocks the distribution if there is a pending agreement.
1
0
43
1d