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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

Cannot catch `std::invalid_argument` on clang++ under m1 -fno-rtti
Today I got stuck with a weird behaviour with my c++ project. There is the code which doesn't catch exception from standard library (the same snippet works well on intel mac and under linux machines). Code snippet: #include <exception> #include <stdexcept> #include <iostream> #include <string> int main() { try { std::stod("notanumber"); } catch (const std::invalid_argument&) { std::cerr << "Caught std::invalid_argument" << std::endl; } } Compilation command: clang++ -fno-rtti main.cpp -o main && ./main Clang versions: clang++ --version Homebrew clang version 15.0.3 Target: arm64-apple-darwin21.6.0 Thread model: posix InstalledDir: /opt/homebrew/opt/llvm/bin Also tried: Apple clang version 14.0.0 (clang-1400.0.29.102) Target: arm64-apple-darwin21.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin Output: libc++abi: terminating with uncaught exception of type std::invalid_argument: stod: no conversion [1] 65643 abort ./main Expected output: Caught std::invalid_argument Other info: Chip: Apple M1 OS: 12.6
4
0
1.4k
Nov ’22
XCode 14.1: Stuck at "Launching Application" after building the project
Hello team, On Xcode 14.1, After building the project and when the simulator launches, it shows blank black screen. Here steps to reproduce: build the project with fresh device. Try changing the language to French in device settings Device should launch in French language. Instead, it loads and goes blank (blank screen) Quit the simulator (XPC error is displayed) and rebuild the project using the same simulator device. Build succeeds and simulator launches, but has blank screen on simulator. Xcode is stuck at "Launching Application" Is this a known issue? Has anyone experienced the same? How can I fix this? Stack (https://stackoverflow.com/questions/74315983/xcode-stuck-on-launching-application) says its a bug, so posting here for recommendations
114
38
48k
Nov ’22
'leaks' message
My app has a debugging mode in which it invokes 'leaks' on itself. I am now seeing this message on stderr: Target process is an ancestor and permitting live process for ancestors so not generating a corpse to save resources by default. This sort of makes sense, but I would like a more detailed explanation. Is there some option I should be sending to 'leaks' to operate in a better mode? Should I be invoking it differently?
3
0
632
Feb ’23
_dispatch_client_callout crash
I received the attached crash report. The problem is that the crash report does not contain the abort reason - it appears to be thrown in the GCD library with no additional information. Is it a possible deadlock? 2023-02-15_02-40-23.0077_+0100-94015bd052c4005658221a5e6279f28a75b9e92c.crash Any ideas?
5
0
2.1k
Feb ’23
PencilKit's PKToolPicker shows normally on iOS, but not on Mac Catalyst.
DemoCode: import SwiftUI import UIKit import PencilKit class PencilKitViewController: UIViewController, PKCanvasViewDelegate, PKToolPickerObserver {       lazy var canvasView: PKCanvasView = {     let canvasView = PKCanvasView()      canvasView.drawingPolicy = .anyInput      canvasView.translatesAutoresizingMaskIntoConstraints = false      return canvasView    }()       lazy var toolPicker: PKToolPicker = {     let toolPicker = PKToolPicker()     toolPicker.showsDrawingPolicyControls = true     toolPicker.addObserver(self)     return toolPicker   }()       let drawing = PKDrawing()       override func viewDidLoad() {     super.viewDidLoad()     canvasView.drawing = drawing     canvasView.delegate = self     view.addSubview(canvasView)   }       override func viewDidLayoutSubviews() {     super.viewDidLayoutSubviews()     canvasView.frame = view.bounds   }       override func viewDidAppear(_ animated: Bool) {     super.viewDidAppear(animated)     toolPicker.setVisible(true, forFirstResponder: canvasView)     toolPicker.addObserver(canvasView)     canvasView.becomeFirstResponder()   }       // canvas   func canvasViewDrawingDidChange(_ canvasView: PKCanvasView) {     print("drawing")   }       func canvasViewDidFinishRendering(_ canvasView: PKCanvasView) {         }       func canvasViewDidEndUsingTool(_ canvasView: PKCanvasView) {         }       func canvasViewDidBeginUsingTool(_ canvasView: PKCanvasView) {         } } // UIRepresentable for SwiftUI struct PencilKitView: UIViewControllerRepresentable {       class Coordinator {     var parentObserver: NSKeyValueObservation?   }       var onSubmit: ((UIImage?, Error?) -> Void)? = .none       func makeUIViewController(context: Context) -> PencilKitViewController {     let pencilKitViewController = PencilKitViewController()     context.coordinator.parentObserver = pencilKitViewController.observe(\.parent, changeHandler: { vc, _ in      })     return pencilKitViewController   }       func updateUIViewController(_ uiViewController: PencilKitViewController, context: Context) {   }       func makeCoordinator() -> Self.Coordinator { Coordinator() } } struct ContentView: View {       var onSubmit: ((UIImage?, Error?) -> Void)? = .none       var body: some View {       PencilKitView()   } } struct ContentView_Previews: PreviewProvider {   static var previews: some View {     ContentView()   } } iOS: macCatalyst:
3
0
2.0k
Mar ’23
Confused about expiring certificates
Hi all, I got the email saying my certificate(s) will be expiring in 30 days. I can view my certificates (distribution, distribution managed, and 2x developments) on my account page. The distribution expires in 30 days (4/20/2023) The distribution managed expires in 6 months Development #1 (under my name) expires in 30 days (4/20/2023) Development #2 (also under my name) expires in 2 months (5/26/2023) However, I don't see any way to renew them. I have read other posts that talk about 'edit' or 'generate' buttons, but I don't see that and I presume those posts are just out of date. When I look in my xcode project, I see that I am using 'automatically manage singing'. Xcode also shows that a provisioning profile is expiring in 2 months. I presume that is something different? It has the same expiration date as my development #2 certificate (5/26/2023). It's also unclear what is going to happen when these certificates expire. I read that devices running builds with the expired distribution cert will stop working. Is that just for internal builds downloaded from something like Test Flight? Will live builds, downloaded by actual players from the AppStore, stop working if I don't push a release with a new cert in the next month? I am the one that set this all up and 'maintains' it, but I don't engage with it often enough to remember the bits and bobs. My apologies for all the newbie questions. Thank you for your assistance
2
0
2.6k
Mar ’23
Video not working on 16.4 simulator
I'm testing a video stream (HLS) with AVPlayer. On XCode 14.3 and simulators running iOS 16.4, there is no video image, only black screen. The audio is playing normally, also progress/duration of the video is showing as expected. The problem does not occur on same XCode version with earlier versions of the simulator. Is this a simulator bug? I've also tested it on real device with iOS 16.4 - no problem there.
25
32
13k
Mar ’23
Info.plist Heeeeeellllp
hello. i have 3 time started a new project now I am making a app and i get a Error code on Info.plist file. I have been trying to resolve an issue with the Info.plist file in an Xcode project. The error message is "Multiple commands produce" related to the Info.plist file. I have tried several approaches to fix the issue, including: Checking the "Copy Bundle Resources" section in the "Build Phases" tab of the project settings to ensure there is only one Info.plist file listed. Deleting the Info.plist file from the project and creating a new one, then updating the reference to the Info.plist file in the "Build Settings" tab. Can anyone help me with this??
4
1
1.4k
May ’23
Xcode cloud errors
Hi community: I'm coming across two error types on Xcode cloud during ui tests. encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying Error: Test crashed with signal kill before starting test execution. If you believe this error represents a bug, please attach the result bundle at /Volumes/workspace/resultbundlexcresult)) encountered an error (Failed to prepare device 'Clone 7 of iPhone 14 Pro' for impending launch. If you believe this error represents a bug, please attach the result bundle at /Volumes/workspace/ resultbundle.xcresult. (Underlying Error: Unable to boot the Simulator. launch failed to respond. (Underlying Error: Failed to start launch_ sim: could not bind to session, launchd_sim may have crashed or quit responding))) Any ideas on how to solve them? Thanks
6
1
2.2k
May ’23
Xcode 14.3: Restarting after unexpected exit, crash, or test timeout - How to debug?
My tests fail with "Restarting after unexpected exit, crash, or test timeout". This is what I have so far established: Does only happen when building with xcodebuild (14.3) but not when building with Xcode (14.3) Tests that are failing are in a .testTarget within a local swift package and part of a test plan together with tests that are in subprojects there are no crashlogs, so likely these tests are not crashing with Xcode 14.2 there are no problems whatsoever (xcodebuild or Xcode) Any ideas on how to debug this any further? Best Roddi
4
1
1.8k
May ’23
The LLDB RPC server has crashed. You may need to manually terminate your process. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log.
The LLDB RPC server has crashed. You may need to manually terminate your process. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log.
1
0
514
May ’23
Error message "Thread 10: EXC_BREAKPOINT (code=1, subcode=0x10515fd44)" in Xcode
I have been getting these error messages in debug window in Xcode: 2023-06-06 07:46:15.412684-0500 Courier[8456:442818] [LayoutConstraints] Unsupported layout off the main thread for _UIModernBarButton with nearest ancestor view controller, UINavigationController 2023-06-06 07:46:15.413268-0500 Courier[8456:442818] [Assert] -[UIImageView _invalidateImageLayouts] must be called on the main queue 2023-06-06 07:46:15.413730-0500 Courier[8456:442818] [Assert] -[UIImageView _layoutForImage:inSize:cachePerSize:forBaselineOffset:] must be called on the main queue (lldb) The messages come when my code crashes and gives this error message in a red ribbon in the editor window: Thread 10: EXC_BREAKPOINT (code=1, subcode=0x10515fd44) In the Debug navigator on the left pane of Xcode, it shows the code stopped at: #0 0x000000010515fd44 in _dispatch_assert_queue_fail () This is what shows at the end in the editor window. At the very end is where the error message in the red ribbon shows: 0x10515fd10 <+68>: add x9, x9, #0xf2f ; "BUG IN CLIENT OF LIBDISPATCH: Assertion failed: " 0x10515fd14 <+72>: stp x9, x8, [sp] 0x10515fd18 <+76>: adrp x1, 65 0x10515fd1c <+80>: add x1, x1, #0xefa ; "%sBlock was %sexpected to execute on queue [%s (%p)]" 0x10515fd20 <+84>: sub x0, x29, #0x18 0x10515fd24 <+88>: bl 0x10519cfc8 ; symbol stub for: asprintf 0x10515fd28 <+92>: ldur x19, [x29, #-0x18] 0x10515fd2c <+96>: str x19, [sp] 0x10515fd30 <+100>: adrp x0, 65 0x10515fd34 <+104>: add x0, x0, #0xf65 ; "%s" 0x10515fd38 <+108>: bl 0x1051986b0 ; _dispatch_log 0x10515fd3c <+112>: adrp x8, 98 0x10515fd40 <+116>: str x19, [x8, #0x268] -> 0x10515fd44 <+120>: brk #0x1 I have no idea which code is causing the error, so I don't even know what code to put in my question. I created a symbolic breakpoint with 'LayoutConstraints' in the Symbol field. It is never tripped. I get no purple warnings that says a line of code should not be in the main thread. I have no idea where to go from here. I don't ind anything when I do a search in the internet that is narrowed down to address my error. I am running the code on an iPhone 13 Pro Max device with iOS 16.5. I am using Xcode 14.3 on a Mac Pro running Ventura 13.4
3
2
1.4k
Jun ’23
Anyone having trouble getting "Export Localizations" to build complex projects?
Running on a Core i9 MacBook Pro with macOS 13.4 (22F66) and the Xcode 15 beta. Running "Export Localizations" seems to work fine with smaller projects, but in my larger project, it's not working unless I do a "Clean" first. The way my project is set up is that the main project depends on a few dynamic frameworks built from other Xcode projects which are incorporated into the main project and set as dependencies. What happens is that I'm getting the error "Unable to build project for localization string extraction. See the build logs for failure description." In the logs, I see that the Link (x86_64) step succeeds, but the Link (arm64) step fails, with a Could not find or use auto-linked framework 'MyFramework' message for each framework dependency that's in another Xcode project. This would suggest that the dependencies are being built only for x86_64. If I clean the project, the "Export Localizations" will then succeed, but if I do a regular build again, "Export Localizations" goes back to being broken. What I think is happening is that the "Export Localizations" workflow is using the same binaries as Debug builds, and leveraging any existing Debug builds that happen to exist instead of rebuilding them, but it's also trying to build for all supported architectures whereas a Debug build usually only builds the current one. This, of course, causes a failure to link to dependent libraries/frameworks, since they don't have binaries for the non-active architecture. Is there any way to turn off building for all architectures for the "Export Localizations" workflow? I don't think it's necessary just for localizations TBH.
6
1
1.5k
Jun ’23
Use of 64pt and 68pt iOS App Icon Sizes
Hi there! Back with Xcode 14 and iOS 16 there were two new app icon sizes introduced to iOS: 64pt @2x (128x128px) 64pt @3x (192x192px) 68pt @2x (136x136px) What are those icons used for? Neither the Xcode 14 release notes nor the Human Interface Guidelines are mentioning those sizes and what they are used for. In previous Xcode versions the asset catalog had labels for each icon size. As Xcode 15 still doesn’t bring that feature back I’m still puzzled when those icon sizes are visible to the user. Best! – Alex
3
0
3.8k
Jun ’23
Upgrading to iPadOS 17 running RoomPlan gets exception on call to Rendering.
Application fails almost immediately after initial entry to rendering code. Could not locate file '.' in bundle. Class for component already registered Registering library () that already exists in shader manager. Library will be overwritten. Resolving material name 'engine:BuiltinRenderGraphResources/AR/suFeatheringCreateMergedOcclusionMask.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle What additional packages need updates to run successfully? I have updated the Xcode and other packages available in Beta set
2
0
1k
Jun ’23