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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

Linker command failed due to Undefined Symbol errors.
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)
1
0
220
2w
Unable to Simulate Messages and Sticker Packs
I'm on a fresh install of MacOS (14.5) with a fresh install of the latest XCode (15.4) and when I create a new Messages app or Sticker Pack, it compiles but fails to deploy on the simulator. (This is the default project configuration provided by Xcode with no changes.) I have tried reinstalling Xcode and the simulators but nothing fixes it. I've tried also changing the device to simulate but it still doesn't work. Regular applications however do deploy on the simulator and work as normal. But Messages and Sticker Packs do not show up on the simulator in the messages app and give the following errors: objc[3958]: 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 (0x1ecbe7280) and /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/Applications/MobileSMS.app/MobileSMS (0x102cd2920). 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:A23DA686-547E-4980-B6EF-F33F6A7A637E] 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: 0x10406d800> 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. 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.} Synchronous remote object got an error attempting to post setup, reason: Couldn’t communicate with a helper application. Duet query failed: 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. 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} 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: 0x600000024150; 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} API MISUSE: Resuming an NSURLSessionTask with nil URL. Task <525FCF57-436C-4CEE-9A83-DC62606B01E5>.<1> finished with error [-1002] Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSUnderlyingError=0x600000c86460 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <525FCF57-436C-4CEE-9A83-DC62606B01E5>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <525FCF57-436C-4CEE-9A83-DC62606B01E5>.<1>" ), NSLocalizedDescription=unsupported URL} unhandled process MobileSMS Requested keyboard snapshot but UIKeyboard.usesInputSystemUI returned NO. Failed to get pid info for pid 0: Operation not permitted Failed to get pid info for pid 0: Operation not permitted mkdir: path=/var/mobile/tmp/com.apple.messages/ mode= -rwx------: [2: No such file or directory]
1
0
155
1w
Pay attention to StoreKit Configuration settings
It's not a question, I just want to share my experience of resolving a bug. We where adding a new product to the app and couldn't get why it's not loading. StoreKit 2 simply did not return the product, so we switched to StoreKit 1 to get invalidProductIdentifiers from the response. The product was there of course. So many time was spend... We checked App Store configuration, everything was approved. Checked id, localization, multiple devices. Everyone start to get mad, we filled issues for RevenueCat and Apple. Then we uploaded a TF build (because product wasn't loading when running from Xcode). And, suddenly the product did appear there! I understood that it can be connected to StoreKit Configuration, since it works only in debugger mode (Debug or Release), but not in TF. But there was no any .storekit files in the project folder. I search it many times - no success. And finally the bug was resolved when I checked Run Scheme. As you can see on the screenshot, it has red value under StoreKit Configuration. That means there where a file before, but than it was removed. So I changed it to None and the product started to work in debug. Great! I hope this post helps, don't fall to the same error as me! Related article: Setting up StoreKit Testing in Xcode
0
0
144
1w
CreateML Object Tracking doesn't enable Train button
I tried to train on some of my USDZs. For some the CreateML viewport shows the object's dimensions and enables the Train button. Many others, including the official USDZ for the iPhone 15Pro (iphone_15_pro_blue_titanium_5G.usdz) do not show the dimensions and keep [Train] disabled. What do I have to author inside the USDZ to make it work? There are no lights or cameras in the asset file, as recommended in the release notes. Also no animations.
2
0
153
1w
ContentView
Hello, I‘ve started developing an App not to long ago on Xcode and I have noticed that I can’t see any progress or like preview of what I have coded so far and it’s starting to concern me. I have Xcode version 15.5 and I am coding with swift, everything works fine there is no error or anything preventing it to run but when I try to preview the only thing I see when I launch the Simulator and I open my app the only thing I see is a white page. Can someone please help me.
2
0
166
1w
Xcode build crashes on: No such module '_SwiftData_SwiftUI'
Building with below imports returns an error. What could I do to mitigate this? I did clean the build cache and delete the derived data folder. import SwiftData import SwiftUI The error: Command SwiftCompile failed with a nonzero exit code /Users/thomas/Documents/Projects/SwiftUI/workouts/Workouts/Workouts/Views/Workout/WorkoutView.swift:9:8 No such module '_SwiftData_SwiftUI' This feedback has also been submitted under: FB14182548
2
1
147
1w
Xcode 16 Beta 2. iOS 18 Simulator Biometrics Issue
Hi, I am trying to achieve biometric authentication in iOS 18 Simulator but getting the below error. The same things works in iOS 17.2 simulator in the same Xcode version that is Xcode 16 Beta 2. - some : Error Domain=com.apple.LocalAuthentication Code=-1000 "UI service connection invalidated." UserInfo={NSDebugDescription=UI service connection invalidated., NSLocalizedDescription=Authentication failure.}
1
0
193
1w
Xcode is running build tool plug-in that has been removed
I recently installed the Swift OpenAPI Generator on my Xcode project. I used it for a little bit but then decided that it would not work how I wanted it to, so I uninstalled it. I uninstalled all the packages related to the OpenAPI generator, and removed the generator from my projects build phases. However, when I try to build and run my project now, I get an error saying that my application could not find the OpenAPI generator script. I did delete this script, but I also removed it as a run build tool plug-in, so it should not be trying to execute in the first place. I used the instructions found in this WWDC23 video (at around the 9:00 minute mark). I am wondering how to completely remove this plug-in. I have tried searching my XCOde project, but I cannot find any indication of this plug-in still existing within my project. I have tried cleaning the build folder as well, but to no avail. What can I do to resolve this issue?
1
0
168
1w
Xcode 15.3 broke agvtool version management
The new version of Xcode 15.3 broke the behavior of incrementing build numbers with agvtool which I used to automate to update the build number after each build. The observation is that after running this in my project directory: agvtool bump Xcode removed the section "Package Dependencies" in the project navigation pane which results in failing a subsequent build with this error message: Missing package product 'mypackage' To solve this I have to reset package caches under File>Packages. This will restore the Package Dependencies section in the navigation pane of Xcode. It seems to be a bug of the new Xcode version 15.3 as this was working without any issues in the previous versions. Any idea?
4
1
861
Mar ’24
SampleTrips Previews work, but not in my primary project.
I wanted to get my SwiftData previews working in my primary project, so I started modeling them after the SampleTrips project. After messing around with that & being unable to make it work, I brought the same (working) sample code into my main project, unfortunately that's not working... I've attached the preview error (note, there's nothing in the Diagnostic Reports). //Sample code that works in it's own project, but not my primary target. import SwiftUI import SwiftData struct TestSwiftDataStuffView: View { let trip: Trip var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, \(trip.name)!") .padding() .foregroundColor(.red) } .padding() } } #Preview(traits: .sampleDataSecondary) { @Previewable @Query var trips: [Trip] TestSwiftDataStuffView(trip: trips.first!) } actor DataModelSecondary { struct TransactionAuthor { static let widget = "widget" } static let shared = DataModelSecondary() private init() {} nonisolated lazy var modelContainer: ModelContainer = { let modelContainer: ModelContainer let schema = Schema([ Trip.self ]) do { let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false, cloudKitDatabase: .none) modelContainer = try ModelContainer(for: schema, configurations: [modelConfiguration]) } catch { fatalError("Failed to create the model container: \(error)") } return modelContainer }() } @Model class Trip { @Attribute(.preserveValueOnDeletion) var name: String init(name: String) { self.name = name } } extension Trip { static var previewTrips: [Trip] { [ Trip(name: "Revenant"), Trip(name: "Newcastle"), Trip(name: "Bianca") ] } } struct SampleDataSecondary: PreviewModifier { static func makeSharedContext() throws -> ModelContainer { let config = ModelConfiguration(isStoredInMemoryOnly: true) let container = try ModelContainer( for: Trip.self, configurations: config ) SampleDataSecondary.createSampleData(into: container.mainContext) return container } func body(content: Content, context: ModelContainer) -> some View { content.modelContainer(context) } static func createSampleData(into modelContext: ModelContext) { Task { @MainActor in let sampleDataTrips: [Trip] = Trip.previewTrips let sampleData: [any PersistentModel] = sampleDataTrips //+ sampleDataLA + sampleDataBLT sampleData.forEach { modelContext.insert($0) } try? modelContext.save() } } } @available(iOS 18.0, *) extension PreviewTrait where T == Preview.ViewTraits { @MainActor static var sampleDataSecondary: Self = .modifier(SampleDataSecondary()) } Xcode16Preview.txt
3
0
339
1w
Failed to install the app on the device
We currently try to run tests on 4 physically attached iPhones all on ios 17. When tests are concurrently running we occasionally get failures that look like this: Testing failed: Failed to install the app on the device. SwiftUITests-Runner encountered an error (Failed to install or launch the test runner. (Underlying Error: Failed to install the app on the device. (Underlying Error: Connection with the remote side was unexpectedly closed : { count = 1, transaction: 0, voucher = 0x0, contents = "XPCErrorDescription" => { length = 22, contents = "Connection interrupted" } }. Unhandled error domain IXRemoteErrorDomain, code 6)) I noticed that when relying on xcodebuild to install the target app and test runner it cannot install concurrently/parallel on all 4 devices but instead does each device sequentially causing the test to hang. The same behavior can be exhibited when trying to install an app concurrently on 4 different phones with xcrun devicectl as well. STEPS TO REPRODUCE Trigger a test with xcodebuild on 4 different phones at the same time where xcodebuild also needs to install the target apps. Currently using Xcode15.2 and iOS 17.5.1
1
0
150
1w
Xcode Version 13.2.1 - install ios 18 and ios 17.5
I created an application in xcode 13, and I need to install it on my iPhone 12 iOS 18. I already went to the Apple Developers website and downloaded the files iOS_17.5_Simulator_Runtime.dmg and also the file iOS_18_beta_Simulator_Runtime.dmg I copied them to the folder on my Mac /Library/Developer/CoreSimulator/Profiles/Runtimes/ And even so, when I opened xcode and went to deployment info, the most recent iOS version is still 15.2 and the last one I downloaded doesn't appear. what should I do ? I preferably want to install iOS 18 beta on my iPhone 12
1
0
150
2w
Issue with Core Simulator Cache Consuming Disk Space
I recently ran out of disk space and discovered that my System Data was consuming 866 GB of storage. After investigating, I found multiple directories named "Dead" nested within my developer data, consuming nearly 600 GB of storage. An example path is: /Users//Library/Developer/CoreSimulator/Devices//data/Library/Caches/com.apple.containermanagerd/Dead These directories contained multiple directories titled "temp.". Rebooting the computer did not empty these "Dead" directories; I had to manually delete them. What is the expected lifespan of the temporary directories stored in the "Dead" directory?
1
0
138
1w
Xcode 15: Multiple Commands Produce Duplicate Info.plist Error
I am encountering a persistent issue in Xcode 15 where multiple commands produce a duplicate Info.plist error. The specific error message is: M u ltiple commands produce '/Users/josephnicholas/Library/Developer/Xcode/DerivedData/Restaurant_Build-bapndkzqxdjxxbacjwattbpeqof/Build/Products/Debug-iphoneos/Restaurant Build.app/Info.plist': Target 'Restaurant Build' (project 'Restaurant Build') has copy command from '/Users/josephnicholas/Desktop/backups/Restaurant Build/Supporting Files/Info.plist' to '/Users/josephnicholas/Library/Developer/Xcode/DerivedData/Restaurant_Build-bapndkzqxdjxxbacjwattbpeqof/Build/Products/Debug-iphoneos/Restaurant Build.app/Info.plist' Target 'Restaurant Build' (project 'Restaurant Build') has process command with output '/Users/josephnicholas/Library/Developer/Xcode/DerivedData/Restaurant_Build-bapndkzqxdjxxbacjwattbpeqof/Build/Products/Debug-iphoneos/Restaurant Build.app/Info.plist' Despite following numerous troubleshooting steps, including deleting the Info.plist file, cleaning the build folder, and creating a new project from scratch, the issue persists. I have ensured the Info.plist path is correctly set in the Build Settings under Packaging, and verified the file's target membership. However, the error remains unresolved. Here is a detailed list of the steps I have taken: Deleted the Derived Data multiple times. Restarted Xcode. Deleted the Info.plist file and re-added it through File > New File. Created a new project and manually copied all the files. Verified the Info.plist path and target membership. Followed suggestions from various forums, including adjusting paths and cleaning the build folder. Unfortunately, these steps have not resolved the issue. Attached are screenshots detailing the error messages and my current project setup. I would greatly appreciate any insights or solutions to this problem.
4
0
225
2w
Xcode bundles all of swift-collection's products even though only one is selected
I've added swift-collections to a project and I only selected OrderedCollections to be added to my target. Coincidentally, I was investigating the size of my apps binary (built and archived with Xcode for App Store Connect) with bloaty and I saw that every package product of swift-collections was somehow linked to the binary (HeapModule, RopeModule, ...). This was the command: bloaty -d compileunits --debug-file=Path_to_dsym_file.dSYM/Contents/Resources/DWARF/{YOUR_APP_NAME} path_to_your_app_binary -n 0 After that I tried importing one of these packages, which just worked, even though as mentioned I did not select them when adding the package. Is this a limitation/bug/feature of Swift Package Manager, or even Xcode? Is this to be expected? I am using Xcode 15.4.
0
0
117
1w
IAP restoration confirmation
When IAP is purchased the following is correctly displayed. “You’re all set Your purchase was successful.” However, when a previous IAP is restored, purchase will be restored but there is no feedback/notification displayed. Therefore, after an IAP is successfully restored, the following feedback/notification would be very helpful (similar to when the app is purchased): “You’re all set Your purchase has been successfully restored” I understand this is not related to coding by the developer but has to do with the apples in-app purchase process.
0
0
49
1w
Xcode playground file saved to desktop
Hello, I am new here and although not entirely new to programming, I am certainly new to Xcode/Swift and creating mobile apps. When I create a Playground file, Xcode asks me where I want to save it. No matter what I enter in the "Save as" box, Xcode saves the file on my desktop. That is not what I want. Can this be changed? I looked in the settings and could not find a clue.
1
0
57
1w
Flutter build fails after MacBook, macOS & Xcode upgrade
Build completes on MacBook Pro with Intel chip running macOS 12.7.1 and Xcode 13.4.1. Build fails on MacBook Air with Apple M2 chip running macOS 14.2.1 and Xcode 15.1. bryonnicoson@Bryons-Air wishbone % flutter doctor -v [✓] Flutter (Channel stable, 3.16.5, on macOS 14.2.1 23C71 darwin-arm64, locale en-US) • Flutter version 3.16.5 on channel stable at /Users/bryonnicoson/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 78666c8dc5 (13 days ago), 2023-12-19 16:14:14 -0800 • Engine revision 3f3e560236 • Dart version 3.2.3 • DevTools version 2.28.4 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/bryonnicoson/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C65 • CocoaPods version 1.14.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2023.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-arm64 • macOS 14.2.1 23C71 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.129 [✓] Network resources • All expected network resources are available. • No issues found! bryonnicoson@Bryons-Air wishbone % flutter build ipa Archiving org.wishbonecaninerescue... Automatically signing iOS for device deployment using specified development team in Xcode project: Y7SP32JD57 Running Xcode build... Xcode archive done. 10.7s Failed to build iOS app Error (Xcode): Target aot_assembly_release failed: Exception: Flutter failed to run "/Users/bryonnicoson/development/flutter/bin/cache/artifacts/engine/ios-release/ gen_snapshot_arm64 --deterministic --snapshot_kind=app-aot-assembly --assembly=/Users/bryonnicoson/projects/wishbone/.dart_tool/flutter_build/3845b4 145dcae82f344df65f7b356936/arm64/snapshot_assembly.S /Users/bryonnicoson/projects/wishbone/.dart_tool/flutter_build/3845b4145dcae82f3 44df65f7b356936/app.dill". Encountered error while archiving for device.
3
1
597
Jan ’24