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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

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
166
1w
Xcode quit Unexpectedly
whenever i run xcode i'm facing this error please help- Translated Report (Full Report Below) Process: Xcode [1652] Path: /Users/USER/Desktop/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 10.1 (14460.46) Build Info: IDEFrameworks_Fall2018-14460046000000000~5 (10B61) Code Type: X86-64 (Native) Parent Process: zsh [1646] Responsible: Terminal [1644] User ID: 501 Date/Time: 2024-07-04 16:40:54.0061 +0530 OS Version: macOS 12.7.5 (21H1222) Report Version: 12 Anonymous UUID: 43ECF59E-B6E9-40C9-FB05-BD0BC3DEECF1 Sleep/Wake UUID: DCFAF1AC-F53C-4271-8CF0-B11CAB4CAAB8 Time Awake Since Boot: 6000 seconds Time Since Wake: 157858150 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x00007ff81d3bf8f1 Exception Codes: 0x0000000000000002, 0x00007ff81d3bf8f1 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 10 Bus error: 10 Terminating Process: exc handler [1652] VM Region Info: 0x7ff81d3bf8f1 is in 0x7ff81d200000-0x7ff81d400000; bytes after start: 1833201 bytes before end: 263950 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL __TEXT 7ff81c833000-7ff81d200000 [ 9.8M] r-x/r-x SM=COW ...ions/C/AppKit ---> __TEXT 7ff81d200000-7ff81d400000 [ 2048K] r-x/rwx SM=COW ...ions/C/AppKit __TEXT 7ff81d400000-7ff81d6c3000 [ 2828K] r-x/r-x SM=COW ...ions/C/AppKit Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libMainThreadChecker.dylib 0x1069aa069 swizzleImplementationFast + 115 1 libMainThreadChecker.dylib 0x1069a9ef0 addSwizzler + 165 2 libMainThreadChecker.dylib 0x1069a9ae6 __library_initializer + 2939 3 dyld 0x105d79e4f invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 182 4 dyld 0x105d66db3 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 129 5 dyld 0x105da0556 dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 292 6 dyld 0x105d79d82 dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 144 7 dyld 0x105d79f0e dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 178 8 dyld 0x105d79fb2 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 108 9 dyld 0x105d88e00 dyld4::APIs::dlopen_from(char const*, int, void*) + 592 10 IDEFoundation 0x10460101e _IDEInitializeMainThreadChecker + 400 11 IDEFoundation 0x104601a59 IDEInitialize + 1021 12 IDEKit 0x107077e96 -[IDEApplicationController applicationWillFinishLaunching:] + 623 13 CoreFoundation 0x7ff819e2a66c CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 12 14 CoreFoundation 0x7ff819ec7a62 ___CFXRegistrationPost_block_invoke + 49 15 CoreFoundation 0x7ff819ec79e0 _CFXRegistrationPost + 496 16 CoreFoundation 0x7ff819dfc2d8 _CFXNotificationPost + 735 17 Foundation 0x7ff81ac3b59e -[NSNotificationCenter postNotificationName:object:userInfo:] + 82 18 DVTFoundation 0x1029a9c1d -[NSNotificationCenter(DVTNSNotificationCenterAdditions) _dvt_postNotificationName:object:userInfo:] + 361 19 AppKit 0x7ff81c862abe -[NSApplication finishLaunching] + 327 20 DVTKit 0x103062326 -[DVTApplication finishLaunching] + 294 21 AppKit 0x7ff81c8626c8 -[NSApplication run] + 250 22 AppKit 0x7ff81c83679a NSApplicationMain + 817 23 Xcode 0x101df682e main + 574 24 dyld 0x105d6a52e start + 462 Thread 1: 0 libsystem_pthread.dylib 0x7ff819d69f48 start_wqthread + 0 Thread 2: 0 libsystem_pthread.dylib 0x7ff819d69f48 start_wqthread + 0 Thread 3: 0 libsystem_pthread.dylib 0x7ff819d69f48 start_wqthread + 0 Thread 4: 0 libsystem_pthread.dylib 0x7ff819d69f48 start_wqthread + 0 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000100 rbx: 0x00007ff8341cb260 rcx: 0x00007ff837627608 rdx: 0x00007ff837427608 rdi: 0x00000001069aaefe rsi: 0x0000000000000100 rbp: 0x00007ff7be107870 rsp: 0x00007ff7be107850 r8: 0x0000000000000000 r9: 0x0000000000000830 r10: 0xb656bf33267d4fd1 r11: 0x61c886a9f021f049 r12: 0x0000000106980838 r13: 0x00007ff81d3bf8e1 r14: 0x0000000106980838 r15: 0x00007ff81d3bf8e1 rip: 0x00000001069aa069 rfl: 0x0000000000010202 cr2: 0x00007ff81d3bf8f1
1
0
110
1w
iOS18, interactive widget not respond (AppIntent not working)
here is my case: i add the AppIntent to both your app and widget extension targets. the intent will run my app process when app is running. it works perfectly on iOS 17. but iOS 18, my app process never called. i download app's demo, https://developer.apple.com/documentation/widgetkit/emoji-rangers-supporting-live-activities-interactivity-and-animations it looks like the same issue. it runs well because even it runs in the widget extension target, it still can present expected UI. but in real case, we need to run the app process to do some work. by debugging, i found the app process never called(set breakpoint). i add openAppWhenRun, it works well on iOS 18. but it will open the app when the widget is running. it is not what i want.
1
0
203
1w
How to debug over-release in Objective-C with ARC?
I'm getting a runtime assertion failure like this: "<FFRender3DView 0x616000271580> has reached dealloc but still has a super view. Super views strongly reference their children, so this is being over-released, or has been over-released in the past." Looking at the code, I can't see any strong reference to the view except by its superview, so I can't see how it could be released other than by removal from its superview. My first instinct was to override release and set a breakpoint there, but that's not possible in ARC code.
2
0
205
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
147
1w
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
337
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
146
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
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 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
115
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
48
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
56
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
Xcode 15 build error Info.plist "error: Build input file cannot be found:..."
I've been trying to add an 'Info.plist' file this afternoon and get a recurring error that I haven't seen before. I see a lot of other people have posted similar errors over the time but I con't seen any solutions posted. I'd appreciate anyone reading this giving it a boost to perhaps have an engineer post a solution so others will not waste as much time on this as I have. . Info.plist has the proper path, I do not have a 'script phase' or 'custom build rule', and I don't know what "Did you forget to declare this file as an output of a script phase or custom build rule" means. I've had Info.plists before, I'm just not sure why I'm getting this error or how to bypass it.
1
0
250
2w
App data file not being read in TestFlight
An app I'm developing uses a text data file to access some words. The app runs fine in all simulators and when directly hard-wired from my Mac to my iPhone. When I download it to App Store Connect and run the app in TestFlight the app runs fine except when it tries to access the data file. The error it gives me is that it can't access the same data that I access when running the app in the simulators.
1
0
105
2w
Unable to use SWIFT_EXPLICIT_MODULES
I'm following the guidance from [wwdc24/10171] using Xcode 16 beta 2 on Sonoma (https://developer.apple.com/wwdc24/10171) and find myself unable to active the _EXPERIMENTAL_SWIFT_EXPLICIT_MODULES = YES setting. I tried both in the project file and in the XCConfig file and nothing. After cleaning and building with timing summary, I can't find any "Compiling Swift module" nor any "modules report". I only get multiple statements of "Compiling clang module" and the "GenerateClangModulesReport" What am I doing wrong?
1
0
164
2w
Predictive code completion is not supported in this region
I'm using beta 2 of Xcode 16 on an M1 MacBook with 32 GB of memory, running macOS 15 beta 2. It didn't appear that predictive code completion was working as exhibited in the developer videos, so I tried to figure out what's going on. The Xcode documentation mentions that you can disable predictive code completion in Settings, so I checked there. The checkbox to turn it on is disabled. When I click the "I" button to its right, it tells me that "Predictive code completion is not supported in this region." I am in the US with my system set to US English. What do I have to do to be able to experience this feature?
2
1
215
2w