Build, 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

After upgrading the mac to the latest version, simulator(17.4.1) getting crash in every few minutes after launch or hangs and nothing works
Incident Identifier: 8C757080-1227-4FF8-9563-D4AAFE0587BE CrashReporter Key: ACD5C28C-DD36-0D52-56E8-477D2887C6A8 Hardware Model: MacBookAir9,1 Process: Runner [52298] Path: /Users/USER/Library/Developer/CoreSimulator/Devices/E4009C5D-4435-4F7F-BD7E-140632A9CF45/data/Containers/Bundle/Application/88AF44ED-BA26-420D-B011-BA09712D1A56/Runner.app/Runner Identifier: com.test.AppName Version: 1.0.0 (1) Code Type: X86-64 (Native) Role: Foreground Parent Process: launchd_sim [45746] Coalition: com.apple.CoreSimulator.SimDevice.E4009C5D-4435-4F7F-BD7E-140632A9CF45 [25888] Responsible Process: SimulatorTrampoline [45605] Date/Time: 2024-05-21 18:03:39.1450 +0530 Launch Time: 2024-05-21 17:55:53.3837 +0530 OS Version: macOS 14.5 (23F79) Release Type: User Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: SIGNAL 6 Abort trap: 6 Terminating Process: Runner [52298] Triggered by Thread: 0 Last Exception Backtrace: 0 CoreFoundation 0x7ff8004cd561 __exceptionPreprocess + 226 1 libobjc.A.dylib 0x7ff8000837e8 objc_exception_throw + 48 2 CoreFoundation 0x7ff8004cd44f -[NSException initWithCoder:] + 0 3 Runner 0x1043430ed -[GIDSignIn signInWithOptions:] + 173 (GIDSignIn.m:513) 4 Runner 0x104341ee0 -[GIDSignIn signInWithPresentingViewController:hint:additionalScopes:completion:] + 208 (GIDSignIn.m:264) 5 Runner 0x104ed66e8 -[FLTGoogleSignInPlugin signInWithHint:additionalScopes:completion:] + 184 (FLTGoogleSignInPlugin.m:252) 6 Runner 0x104ed54b5 -[FLTGoogleSignInPlugin signInWithCompletion:] + 901 (FLTGoogleSignInPlugin.m:152) 7 Runner 0x104edaf58 __FSIGoogleSignInApiSetup_block_invoke.175 + 168 (messages.g.m:266) 8 Flutter 0x10e0643df __48-[FlutterBasicMessageChannel setMessageHandler:]_block_invoke + 171 9 Flutter 0x10da1d0e1 invocation function for block in flutter::PlatformMessageHandlerIos::HandlePlatformMessage(std::_fl::unique_ptr<flutter::PlatformMessage, std::_fl::default_deleteflutter::PlatformMessage>) + 94 10 libdispatch.dylib 0x7ff8001783ec _dispatch_call_block_and_release + 12 11 libdispatch.dylib 0x7ff8001796d8 _dispatch_client_callout + 8 12 libdispatch.dylib 0x7ff80018848c _dispatch_main_queue_drain + 1420 13 libdispatch.dylib 0x7ff800187ef2 _dispatch_main_queue_callback_4CF + 31 14 CoreFoundation 0x7ff800429b34 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 15 CoreFoundation 0x7ff80042446f __CFRunLoopRun + 2463 16 CoreFoundation 0x7ff8004236ed CFRunLoopRunSpecific + 557 17 GraphicsServices 0x7ff8103ba08f GSEventRunModal + 137 18 UIKitCore 0x7ff805cdf6ee -[UIApplication _run] + 972 19 UIKitCore 0x7ff805ce416e UIApplicationMain + 123 20 Runner 0x1041cb10f main + 63 (AppDelegate.swift:5) 21 dyld_sim 0x107d023e0 start_sim + 10 22 dyld 0x10d902366 start + 1942 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x107e4914a __pthread_kill + 10 1 libsystem_pthread.dylib 0x107eaaebd pthread_kill + 262 2 libsystem_c.dylib 0x7ff80016dd1c abort + 133 3 libc++abi.dylib 0x7ff8002c6d12 abort_message + 241 4 libc++abi.dylib 0x7ff8002b951a demangling_terminate_handler() + 266 5 libobjc.A.dylib 0x7ff800061fba _objc_terminate() + 96 6 libc++abi.dylib 0x7ff8002c616b std::__terminate(void (*)()) + 6 7 libc++abi.dylib 0x7ff8002c6126 std::terminate() + 54 8 libdispatch.dylib 0x7ff8001796ec _dispatch_client_callout + 28 9 libdispatch.dylib 0x7ff80018848c _dispatch_main_queue_drain + 1420 10 libdispatch.dylib 0x7ff800187ef2 _dispatch_main_queue_callback_4CF + 31 11 CoreFoundation 0x7ff800429b34 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 12 CoreFoundation 0x7ff80042446f __CFRunLoopRun + 2463 13 CoreFoundation 0x7ff8004236ed CFRunLoopRunSpecific + 557 14 GraphicsServices 0x7ff8103ba08f GSEventRunModal + 137 15 UIKitCore 0x7ff805cdf6ee -[UIApplication _run] + 972 16 UIKitCore 0x7ff805ce416e UIApplicationMain + 123 17 Runner 0x1041cb10f main + 63 (AppDelegate.swift:5) 18 dyld_sim 0x107d023e0 start_sim + 10 19 dyld 0x10d902366 start + 1942 Thread 1:: com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0x107e423ce mach_msg2_trap + 10 1 libsystem_kernel.dylib 0x107e50c88 mach_msg2_internal + 84 2 libsystem_kernel.dylib 0x107e49510 mach_msg_overwrite + 653 3 libsystem_kernel.dylib 0x107e426bd mach_msg + 19 4 CoreFoundation 0x7ff8004298a3 __CFRunLoopServiceMachPort + 143 5 CoreFoundation 0x7ff80042402b __CFRunLoopRun + 1371 6 CoreFoundation 0x7ff8004236ed CFRunLoopRunSpecific + 557 7 Foundation 0x7ff800ea8c9a -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 213 8 Foundation 0x7ff800ea8f18 -[NSRunLoop(NSRunLoop) runUntilDate:] + 72 9 UIKitCore 0x7ff805dbc7aa -[UIEventFetcher threadMain] + 518 10 Foundation 0x7ff800ed34d5 NSThread__start + 1024 11 libsystem_pthread.dylib 0x107eab18b _pthread_start + 99 12 libsystem_pthread.dylib 0x107ea6ae3 thread_start + 15 AirPort: Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports Network Service: Wi-Fi, AirPort, en0 USB Device: USB31Bus USB Device: USB31Bus USB Device: T2Bus USB Device: Touch Bar Backlight USB Device: Apple Internal Keyboard / Trackpad USB Device: Headset USB Device: Ambient Light Sensor USB Device: FaceTime HD Camera (Built-in) USB Device: Apple T2 Controller Thunderbolt Bus: MacBook Air, Apple Inc., 86.0
0
0
119
1w
Could Not Launch Mac (Designed for iPad) App in Xcode
I get the following message when I try to run this app in Xcode. Could not launch AppName. Runningboard has returned error 5. Please check the system logs for the underlying cause of the error. Interestingly, the destination Mac (Mac Catalyst) destination does launch. The funny thing is there is a companion app almost exactly like this one that launches fine. Any help with this would be greatly appreciated. Xcode helped me to file a feedback. The number is FB13206919.
8
1
1.7k
1w
Can't disable App Sandbox
My Xcode workspace contains build settings for a macOS, iOS, and tvOS application. My Sandbox macOS app builds just fine and works great - and is on the App Store. I am in the process of creating a new build / branch of this app that is not Sandboxed so that I can add IPC (Syphon support) - as I don't think I can use App Groups to enable CFMessage support (which Syphon requires) because Syphon (third party framework) - uses its own naming convention for the ports. Anyway, sandbox support for a Syphon app is a topic for another day (it's actually quite disappointing that I can't release a Syphon version on the App Store). The trouble I am having, is that even afer deleting the App Sandbox entitlement from my project, my App still seems to be running in the App Sandbox, and I can't figure out how to remove the App Sandbox entitlement completely. What I am seeing, is that even after deleting the App Sandbox entitlement (using the project settings and deleting it in the "Signing and Capabilities" tab (and also checking the entitlements file manually to doubly make sure it is gone) - I am still seeing the following error message: *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x8703, name = 'info.v002.Syphon.332143F7-0916-428A-A88A-59B752F95304' See /usr/include/servers/bootstrap_defs.h for the error codes. It is also saving my Application Support data in the ~/Library/Containers folder, and not in ~/Library/ApplicationSupport What step am I missing?
7
0
228
1w
Automatic signing failed
I have added an additional capability called "User Assigned Device Name" into my application(The provisions for Development, Ad hoc & App Store Connect etc already received from Apple). Since then we are facing issues on code signing. We are trying to Sign in Automatically and getting the below error always. /.xcodeproj Provisioning profile "iOS Team Provisioning Profile: com..*******" doesn't include the com.apple.developer.contacts.notes entitlement. Contact notes entitlements are not a part of our additional capabilities as we requested separately with Apple and received it in the provisioning profile long back. Actually that time the same(contacts notes entitlements) was not a part of the additional capabilities. Please advise if any one has gone through such a conflict and resolved.
0
0
120
1w
spacial computing
Hello, I've test Apple spacial computing since few weeks now. I've hope working on spacial computer will give me more productive. At this time, safari extensions I use (bitwarden) was not available. There is no other web browser available. I've not find how to use xcode in my spacial computer. I've not find any native (not iPad) terminal tool. Mac screen sharing only give me one screen (and I've got 4 in my desk). This screen can be very big but I prefer having 4 little screen better a big one. And screen sharing is not usable using mouse at all. my mouse always disapear from my screen when sharing with my spacial computer. For all theses case, using spacial computing for working is not realist at this time in my specific case. I lost to many time using it instead of using a "real" computer. Hope this message can help you to upgrade software and give me all tools needed to use it to work. Best regards, Julien Boquet
0
0
133
1w
custom configuration file icon for Mac is not showing. i think it might be an plist issue
i am working application ABC where user can save configuration. Then later it can be open using same file. but when i am saving this configuration file. its not showing the icon. the application is built using qt c++.. here is my plist what is the possible cause? i tried directly providing path of icon in plist. i tried CFBundleSignature from ???? to ABCC
2
0
160
1w
Xcode 15.3+ bug: framework tests executed in fresh simulator fail to write data to disk
I have filed this as FB13722352. I am sharing it here because I haven't seen it mentioned anywhere online yet and am curious if anyone else has run into it. In Xcode 15.3+, writing data to disk fails when running the tests for a Framework project in a fresh simulator. Specifically, if the selected simulator has never been launched before (i.e. is newly-created), any test execution that attempts to write data into the NSDocumentDirectory directory will fail for a period of time after the simulator is first launched (I've observed between 10s and 20s). After that period of time, the same data write action will succeed. It appears that Xcode 15.3+ is starting test execution too soon, without waiting a sufficient amount of time for the Simulator to fully boot. This issue does not occur in Xcode 15.2 or prior versions. Since the issue only appears in a fresh (never-before booted) simulator, it is likely to pop up consistently in CI test runs (where simulators are not re-used). This can cause confusion because the same test would not fail locally when re-using an existing simulator. When the issue appears, the file write API returns the following error: Domain=NSCocoaErrorDomain Code=4 "The folder “testFile” doesn’t exist." UserInfo={NSFilePath=[...]/data/Documents/testFile, NSUserStringVariant=Folder, NSUnderlyingError= {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"} } Reproduction Steps: Open Xcode 15.3 or 15.4. Make sure Simulator.app is closed. Using the "Devices and Simulators" window, create a new iPhone 15 Pro simulator with iOS 17.4 (other devices and OS versions work as well). Do not launch this new simulator. Create a new Framework project and add a test that performs and then checks the output of a data write to the Document directory (see example test code below). Select the new simulator (created in step 2) as the test run target and run the test. Here's an example test that fails in the scenario outlined above: - (void)testBasicRepro { NSString *testString = @"Hello, World!"; NSData *data = [testString dataUsingEncoding:NSUnicodeStringEncoding]; // Get documents directory NSURL *url = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; NSURL *testFileURL = [url URLByAppendingPathComponent:@"testFile"]; // Write the data NSError *error; bool result = [data writeToURL:testFileURL options:NSDataWritingAtomic error:&error]; // Check if it was successful XCTAssertTrue(result); XCTAssertNil(error); XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:testFileURL.path]); } Workaround The workaround that I have come up with is to create a test that runs first (by disabling parallelization and randomization, and making sure the test class filename is alphabetically first). Alternatively, it could be called from the setUp method in any test files that are affected. This test performs a data write and checks the result in a loop in order to block until the data write succeeds (i.e. the Simulator is sufficiently booted for data write operations to complete). - (void)testWorkaroundBug { NSString *testString = @"Hello, World!"; NSData *data = [testString dataUsingEncoding:NSUnicodeStringEncoding]; NSError *error; // Get documents directory NSURL *documentsURL = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; NSURL *testFileURL; NSDate *startTime = [NSDate date]; NSLog(@"Starting test at %@", startTime); for (int i = 0; i < 120; i++) { // Create unique URL testFileURL = [documentsURL URLByAppendingPathComponent:[NSString stringWithFormat:@"testFile-%@", @(i)]]; // Write the data BOOL success = [data writeToURL:testFileURL options:NSDataWritingAtomic error:&error]; // Check if it exists if (success && [[NSFileManager defaultManager] fileExistsAtPath:testFileURL.path]) { NSLog(@"Test file %@ was created successfully! Elapsed time %@s", @(i), @(fabs([startTime timeIntervalSinceNow]))); return; } else { NSLog(@"Test file %@ was not created. Error: %@. Sleeping for 0.5s and trying again.", @(i), error); [NSThread sleepForTimeInterval:0.5]; } } }
1
0
155
1w
Xcode 15.4 - Missing package product "<package name>"
Hello, I'm having this issue that Xcode tells me it cannot find the Swift Packages I'm using within my App. When I first open Xcode, all the Package Dependencies are listed correctly in my project navigator. Also, building the app for the first time runs without any issues. But right after the first build is finished, the Package Dependencies are not listed any more and the build fails, telling me that all the packages are missing. I have to manually click on File -> Packages -> Reset Package Caches, after that it works again. But only for exactly one build. I basically have to do this step for every single build. I found out that there is this Package.resolved file which lists all the used packages with their respective version and some kind of hash. This file is located inside the .xcodeproj file, in my case it's this location: MyApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved This file is deleted after the successful build. And I think that's the reason why all of a sudden Xcode screams that the packages are missing. After resetting the package caches this file re-appears. But it seems it has to be regenerated every single time. This bug is VERY annoying and exists already since the last view versions of Xcode, not just the latest one. I was hoping this bug is fixed at some point. Current Xcode version: 15.4 (15F31d) MacBook Air 13", M3, 2024 running macOS Sonoma 14.5 Just in case, my Package.resolved file is attached below. Package.resolved
0
1
269
1w
Error App Xcode TestFlight EXC_CRASH
Hello everyone, could someone help me please; I am loading an application in testflight in my Apple Store Connect but when downloading the app on my iPhone device the app has an error and cannot start, I attach the error log that I get from my app. log.crash I am using these versions xcode and MAC versions
0
0
70
1w
"Multiple Commands Produce Info.plist" error in Xcode 15
I keep on getting the same error when trying to build my project. It seems to stem from a problem that I am having entering the path to the info.plist file in packaging/build settings. I have repeatedly tried to install the proper path as "$(SRCROOT)/Main Project Group/Info.plist", yet as soon as I hit return, the path reverts to "/Users/josephnicholas/Documents/dEATour/Xcode/dEATourSunday/Main Project Group/Info.plist" and I get the following error when I clean/build the project: "/Users/josephnicholas/Documents/dEATour/Xcode/dEATourSunday/dEATourSunday.xcodeproj One of the paths in DEVELOPMENT_ASSET_PATHS does not exist: /Users/josephnicholas/Documents/dEATour/Xcode/dEATourSunday/dEATourSunday/Preview Content". I have deleted the info.plist file and reinstalled it, I have even started a new project this morning, transferring all of my files. I cannot figure out how to prevent the path in 'packaging' from reverting back to the absolute path and throwing this error out. I'd really appreciate any help anyone can offer. Thanks.
3
0
180
1w
App Store Connect incorrectly considering submission from Xcode as Beta
When attempting to add a recent build to an External test group, I am receiving the error: This build is using a beta version of Xcode and can’t be submitted. Make sure you’re using the latest version of Xcode or the latest seed release found on the releases tab in News and Updates This build is a macOS app built with Unity, which is then codesigned, packaged with productbuild, and then uploaded with xcrun altool --upload-package. The version of Xcode being used was released about a week ago. Xcode Version 15.4 (15F31d), built of an Intel Mac Mini running macOS 14.4.1 (23E224). I have seen threads in the past about this, but nothing recent. (1,2)
0
1
179
1w
XCode asset catalog causes NSImage to be unclickable
I'm having an issue where when my asset catalog have more than 2 images (all have @1x @2x and @3x and PNG format), my NSImage in my NSImageView cannot be clicked. Does anyone know why this happens? Thanks in advance! import SwiftUI struct ContentView: View { @State private var window: NSWindow? var body: some View { VStack { Button("Open Window") { // Create and show the NSWindow self.window = NSWindow( contentRect: NSScreen.main?.frame ?? NSRect.zero, styleMask: [.borderless], backing: .buffered, defer: false ) // Set up window properties self.window?.isOpaque = false self.window?.hasShadow = false self.window?.backgroundColor = .clear self.window?.level = .screenSaver self.window?.collectionBehavior = [.canJoinAllSpaces] self.window?.makeKeyAndOrderFront(nil) // Create an NSImageView let petView = PetView() // Add the NSImageView to the window's content view if let contentView = self.window?.contentView { contentView.addSubview(petView) // Center the petView petView.centerXAnchor.constraint(equalTo: contentView.centerXAnchor).isActive = true petView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor).isActive = true } } } } } class PetView: NSImageView { override init(frame frameRect: NSRect = .zero) { super.init(frame: frameRect) self.image = NSImage(named: "dog_idle-1") self.translatesAutoresizingMaskIntoConstraints = false } required init?(coder: NSCoder) { super.init(coder: coder) } override func mouseDown(with event: NSEvent) { print("woof!") } } I've tried changing the amount of images in my asset catalog and found that 2 is the maximum amount for my NSImage to be clickable. It suppose to print "woof!" when i click on it.
0
0
129
1w
Controlling spacial video from floating window
I've created a Full Immersive VisionOS project and added a spacial video player in the ImmersiveView swift file. I have a few buttons on a different VideosView swift file on a floating window and i'd like switch the video playing in ImmersiveView when i click on a button in VideosView file. Video player working great in ImmersiveView: RealityView { content in if let videoEntity = try? await Entity(named: "Video", in: realityKitContentBundle) { guard let url = Bundle.main.url(forResource: "video1", withExtension: "mov") else {fatalError("Video was not found!")} let asset = AVURLAsset(url: url) let playerItem = AVPlayerItem(asset: asset) let player = AVPlayer() videoEntity.components[VideoPlayerComponent.self] = .init(avPlayer: player) content.add(videoEntity) player.replaceCurrentItem(with: playerItem) player.play() }else { print("file not found!") } } Buttons in floating window from VideosView: struct VideosView: View { var body: some View { VStack{ Button(action: {}) { Text("video 1").font(.title) } Button(action: {}) { Text("video 2").font(.title) } Button(action: {}) { Text("video 3").font(.title) } } } } In general how do I control the video player across views and how do I replace the video when each button is selected. Any help/code/links would be greatly appreciated.
1
0
184
2w
Suppressing "Known Hang" warnings with PERFC_SUPPRESSION_FILE
Recently we have started refactoring some code to use Swift concurrency in Xcode 15.3. As we have added some new async methods and Tasks, new runtime warnings have emerged titled "Known Hang" and several are listed. None of the stack traces listed with these warnings are in areas directly modified but some of the same types/methods called are also called from the modified areas. So I can sort of understand why they are coming up...but they had to have been there before we added the Swift concurrency. Example of a tooltip with the warnings: My first query is: Are these warnings only issued when Swift concurrency is added/applied (as they were not there when using closures and mostly just off the main thread to network calls)? The documentation indicates these can all be suppressed by turning off the Thread Performance Checker BUT I would rather just suppress the few places as we refactor our codebase (as it is quite large). In that way, any new ones may be documented and we can decide to fix them now or later. I have tried to follow the instructions and added an environment variable PERFC_SUPPRESSION_FILE (in the Scheme) with a full path to a file formatted similarly to the example in the documentation. class:NSManagedObjectContext method:-[NSManagedObjectContext save:] My second query is: I have verified that the variable is set by reading it from the ProcessInfo. However, regardless of my settings, the runtime warnings are still presented. I could not find any examples or even any mention of others using this environment variable. I am reaching out with any advice or ideas to try. Has anyone successfully tried this or found an issue/alternative? Help me Mr. Wizard!
3
0
222
2w
Unable to Verify App on iPhone for Xcode Deployed App
I have built the app on xcode and deployed it on my ios device. I am using a personal team account using my apple id. It is an xcode managed profile. I go to VPN & Device Management and accept the developer which works, but then when I hit "Verify App" there is a blink and nothing happens and no error code. I have fine internet I am able to access websites and I do not have a VPN.
0
0
146
2w
Loading CoreML model increases app size?
Hi, i have been noticing some strange issues with using CoreML models in my app. I am using the Whisper.cpp implementation which has a coreML option. This speeds up the transcribing vs Metal. However every time i use it, the app size inside iphone settings -> General -> Storage increases - specifically the "documents and data" part, the bundle size stays consistent. The Size of the app seems to increase by the same size of the coreml model, and after a few reloads it can increase to over 3-4gb! I thought that maybe the coreml model (which is in the bundle) is being saved to file - but i can't see where, i have tried to use instruments and xcode plus lots of printing out of cache and temp directory etc, deleting the caches etc.. but no effect. I have downloaded the container of the iphone from xcode and inspected it, there are some files stored inthe cache but only a few kbs, and even though the value in the settings-> storage shows a few gb, the container is only a few mb. Please can someone help or give me some guidance on what to do to figure out why the documents and data is increasing? where could this folder be pointing to that is not in the xcode downloaded container?? This is the repo i am using https://github.com/ggerganov/whisper.cpp the swiftui app and objective-C app both do the same thing i am witnessing when using coreml. Thanks in advance for any help, i am totally baffled by this behaviour
0
0
167
2w
Xcode 15.4 debugger input not active
Hello, I've upgraded Xcode to newest 15.4 and now I cannot edit text in the output console (debugger). The Xcode console (output) does not allow editing text and does not allow any text input anymore. I've seen that this may be related to structured logging. I used to mark things in console output by typing some notes for me when debugging. How to do that? How to make Xcode console allow input like add line break to mark items in my log, or add notes?
0
0
142
2w