Hi there,
In a project that I am working on, whenever I try running instruments for allocations to see the memory allocations that are happening under the hood, I see the statistics, and the traces updating, however the chart never updates.
I have made new projects on the machine, and I have tried different Xcode versions, and they all show the chart just fine. I have tried running the project on other machines with no success. I have double checked the arguments and options on the active schema I am trying to profile with the schema of a new project and they are identical.
Here is a picture of how it looks:
My questions are as follows:
What properties and settings can disable the chart from showing up?
What diagnostic steps recommended that I should take?
I can not share a reproducible as this is the only project I have with this problem and it is not mine, but please tell me if there is anything else I can provide in order to debug this.
All the best
Parsa
Debugging
RSS for tagDiscover and resolve issues with your app.
Posts under Debugging tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hey all!
in my personal quest to make future proof apps moving to Swift 6, one of my app has a problem when setting an artwork image in MPNowPlayingInfoCenter
Here's what I'm using to set the metadata
func setMetadata(title: String? = nil, artist: String? = nil, artwork: String? = nil) async throws {
let defaultArtwork = UIImage(named: "logo")!
var nowPlayingInfo = [
MPMediaItemPropertyTitle: title ?? "***",
MPMediaItemPropertyArtist: artist ?? "***",
MPMediaItemPropertyArtwork: MPMediaItemArtwork(boundsSize: defaultArtwork.size) { _ in
defaultArtwork
}
] as [String: Any]
if let artwork = artwork {
guard let url = URL(string: artwork) else { return }
let (data, response) = try await URLSession.shared.data(from: url)
guard (response as? HTTPURLResponse)?.statusCode == 200 else { return }
guard let image = UIImage(data: data) else { return }
nowPlayingInfo[MPMediaItemPropertyArtwork] = MPMediaItemArtwork(boundsSize: image.size) { _ in
image
}
}
MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo
}
the app crashes when hitting
MPMediaItemPropertyArtwork: MPMediaItemArtwork(boundsSize: defaultArtwork.size) { _ in
defaultArtwork
}
or
nowPlayingInfo[MPMediaItemPropertyArtwork] = MPMediaItemArtwork(boundsSize: image.size) { _ in
image
}
commenting out these two make the app work again.
Again, no clue on why.
Thanks in advance
I'm receiving reports from users that my app is crashing immediately after being opened on the Apple Watch Series 10 using watchOS 11.
I've updated my personal Apple Watch Series 8 to watchOS 11 and I'm unable to reproduce this crash using the same release build from the App Store. The version currently on the App Store was built using Xcode 15.4 (22622).
I'm preparing an update that is built using Xcode 16.0 (23051) and have asked one of the users reporting the crash to try a TestFlight build built using Xcode 16.0 and they are no longer experiencing this crash.
As far as I can tell, the only difference between the version on the App Store and the TestFlight build is that it is built with the watchOS 11 SDK included with Xcode 16.0. I don't think any of my app's dependencies (all managed by Swift Package Manager) have been updated in the TestFlight build.
I'm attaching a crash report submitted by one of the users. I believe this is a partially symbolicated crash report and have tried opening it in Xcode in an attempt to make it fully symbolicated without success. I've also received a video recording of the app crashing.
I'm also not able to see any crashes occurring with an Apple Watch Series 10 in the Xcode Organizer, which leads me to believe this crash may be occurring at the Springboard level.
Any help to further diagnose this issue would be much appreciated.
When installing the application on my iPhone, connected using USB cable, i am facing the following issue:
ERROR: The application failed to launch. (com.apple.dt.CoreDeviceError error 10002 (0x2712))
NSLocalizedRecoverySuggestion = Provide a valid bundle identifier.
NSLocalizedFailureReason = The requested application VALID_BUNDLE_IDENTIFIER is not installed.
BundleIdentifier = VALID_BUNDLE_IDENTIFIER
----------------------------------------
The operation couldn?t be completed. (OSStatus error -10814.) (NSOSStatusErrorDomain error -10814 (0xFFFFD5C2))
_LSFunction = runEvaluator
_LSLine = 1734
10:02:16 Acquired tunnel connection to device.
10:02:16 Enabling developer disk image services.
10:02:17 Acquired usage assertion.
error MT1045: Failed to execute 'devicectl': 'devicectl -j /var/folders/vq/cdyy2xmd7g9cly1gh_hzvsj00000gn/T/tmp93djQj.tmp device process launch --terminate-existing --device "User’s iPhone" VALID_BUNDLE_IDENTIFIER --monodevelop-port 10000 --connection-mode usb' returned the exit code 1
Xcode version used: 15.4
IDE used to deploy the app: Visual Studio for MAC
I just upgraded to Version 16.0 (16A242d) and unfortunately the App that used to run perfectly fine on Xcode 15 is now broken. It crashes right after showing the Launch Screen on the Simulator. Here's the formatted error message in the Console:
dyld[80159]: Library not loaded: @rpath/AppName-iOS.debug.dylib
Referenced from: <App ID> /path/to/AppName-iOS.app/AppName-iOS
Reason: tried: '/path/to/DerivedData/AppName-iOS.debug.dylib' (no such file),
'/path/to/CoreSimulator/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/AppName-iOS.debug.dylib' (no such file),
'/path/to/AppName-iOS.app/AppName-iOS.debug.dylib' (code signature not valid for use in process: Trying to load an unsigned library),
'/path/to/DerivedData/PackageFrameworks/AppName-iOS.debug.dylib' (no such file),
'/path/to/AppName-iOS.app/Frameworks/AppName-iOS.debug.dylib' (no such file),
'/path/to/CoreSimulator/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/AppName-iOS.debug.dylib' (no such file)
For some reason the Library is unsigned and I've checked all the settings with no luck.
When using the new .navigationTransition feature, when using .searchable at the same time result in the search bar disappearing when dismissing the view you've trasition to, has anyone else experienced this or found any workarounds? Here is an example that make the issue always occur.
@State private var searchText: String = ""
@Namespace private var namespace
let things: [String] = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirdteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty"]
var body: some View {
NavigationStack {
ScrollView {
LazyVStack(spacing: 20) {
ForEach(things, id: \.self) { thing in
NavigationLink(){
SwiftUIView(thing: thing, name: namespace)
}label: {
Text(thing)
}
.matchedTransitionSource(id: thing, in: namespace)
}
}
}
.searchable(text: $searchText)
.navigationTitle("My List")
.navigationBarTitleDisplayMode(.inline)
}
}
}
struct SwiftUIView: View {
var thing: String
var name: Namespace.ID
var body: some View {
Text(thing)
.navigationTransition(.zoom(sourceID: thing, in: name))
}
}
After running the code you end up with this:
And after clicking an element and dismissing it your get this:
Hello,
I'm experiencing a persistent crash in my Expo app on iOS 17.4.1 and subsequently 18.0 (on the iPhone 12 mini) triggered by an EXC_GUARD error.
I've also received the following warning in the XCode build logs:
/Users/expo/workingdir/build/ios/Pods/sqlite3/sqlite-src-3450300/sqlite3.c:60562:24: warning: implicit conversion loses integer precision: 'i64' (aka 'long long') to 'u32' (aka 'unsigned int') [-Wshorten-64-to-32]
The device crash logs are attached below. I'll be looking around for any other fixes, but grateful for your help in the meantime!
ExcUserFault_pppppp-2024-09-18-203642.txt
ExcUserFault_TestFlight-2024-09-21-230842.000.txt
Hello!
After upgrading to Xcode 16 & Swift 6 & iOS 18 I starting receiveing strange crashes.
Happens randomly in different view and pointing to onGeometryChange action block. I added DispatchQueue.main.async { in hopes it will help but it didn't.
HStack {
...
}
.onGeometryChange(for: CGSize.self, of: \.size) { value in
DispatchQueue.main.async {
self.width = value.width
self.height = value.height
}
}
As far as I understand, onGeometryChange is defined as nonisolated and Swift 6 enforce thread checking for the closures, SwiftUI views are always run on the main thread. Does it mean we can not use onGeometryChange safely in swiftui?
BUG IN CLIENT OF LIBDISPATCH: Assertion failed: Block was expected to execute on queue [com.apple.main-thread (0x1eacdce40)]
Crashed: com.apple.SwiftUI.AsyncRenderer
0 libdispatch.dylib 0x64d8 _dispatch_assert_queue_fail + 120
1 libdispatch.dylib 0x6460 _dispatch_assert_queue_fail + 194
2 libswift_Concurrency.dylib 0x62b58 <redacted> + 284
3 Grit 0x3a57cc specialized implicit closure #1 in closure #1 in PurchaseModalOld.body.getter + 4377696204 (<compiler-generated>:4377696204)
4 SwiftUI 0x5841e0 <redacted> + 60
5 SwiftUI 0x5837f8 <redacted> + 20
6 SwiftUI 0x586b5c <redacted> + 84
7 SwiftUICore 0x68846c <redacted> + 48
8 SwiftUICore 0x686dd4 <redacted> + 16
9 SwiftUICore 0x6ecc74 <redacted> + 160
10 SwiftUICore 0x686224 <redacted> + 872
11 SwiftUICore 0x685e24 $s14AttributeGraph12StatefulRuleP7SwiftUIE15withObservation2doqd__qd__yKXE_tKlF + 72
12 SwiftUI 0x95450 <redacted> + 1392
13 SwiftUI 0x7e438 <redacted> + 32
14 AttributeGraph 0x952c AG::Graph::UpdateStack::update() + 540
15 AttributeGraph 0x90f0 AG::Graph::update_attribute(AG::data::ptr<AG::Node>, unsigned int) + 424
16 AttributeGraph 0x8cc4 AG::Subgraph::update(unsigned int) + 848
17 SwiftUICore 0x9eda58 <redacted> + 348
18 SwiftUICore 0x9edf70 <redacted> + 36
19 AttributeGraph 0x148c0 AGGraphWithMainThreadHandler + 60
20 SwiftUICore 0x9e7834 $s7SwiftUI9ViewGraphC18updateOutputsAsync2atAA11DisplayListV4list_AG7VersionV7versiontSgAA4TimeV_tF + 560
21 SwiftUICore 0x9e0fc0 $s7SwiftUI16ViewRendererHostPAAE11renderAsync8interval15targetTimestampAA4TimeVSgSd_AItF + 524
22 SwiftUI 0xecfdfc <redacted> + 220
23 SwiftUI 0x55c84 <redacted> + 312
24 SwiftUI 0x55b20 <redacted> + 60
25 QuartzCore 0xc7078 <redacted> + 48
26 QuartzCore 0xc52b4 <redacted> + 884
27 QuartzCore 0xc5cb4 <redacted> + 456
28 CoreFoundation 0x555dc <redacted> + 176
29 CoreFoundation 0x55518 <redacted> + 60
30 CoreFoundation 0x55438 <redacted> + 524
31 CoreFoundation 0x54284 <redacted> + 2248
32 CoreFoundation 0x535b8 CFRunLoopRunSpecific + 572
33 Foundation 0xb6f00 <redacted> + 212
34 Foundation 0xb6dd4 <redacted> + 64
35 SwiftUI 0x38bc80 <redacted> + 792
36 SwiftUI 0x1395d0 <redacted> + 72
37 Foundation 0xc8058 <redacted> + 724
38 libsystem_pthread.dylib 0x637c _pthread_start + 136
39 libsystem_pthread.dylib 0x1494 thread_start + 8
I got a crashlog of my iPad App from a user and now I have to find out where in the app the problem lies.
I use Xcode Version 16.0 (16A242d) and then follow these steps:
Attach an iPad
Xcode -> Window ->Devices and Simulators
Open Recent Logs
Navigate to the .ips file
Open it
Result:
I can see that the app exceeds the wall-clock allowance
All calls of my app are not symbolicated.
Question:
How can I get Xcode to symbolicate the crashlog properly?
Choose the real iPhone device on my Xcode and build for running. Xcode warn me to vertify the Developer App certification in VPN & Device Management. When I get through it as vertify. The setting page still ask me to vertify the app. I press the "Vertify App" Button and press "Vertify" but it can't work.
And it also cannot preview when I choose my device in the previewer.
But both work well on my iPad Air. I can pass the vertify app and also can preview through Xcode.
I searched the problem in forum.i found someone who has the same problem.
https://developer.apple.com/forums/thread/744579
I try to change my network environment, reboot the device, reboot the develop laptop, but still cannot work.
I'm using
Xcode Version 16.0 (16A242d)
iPhone 14 Pro with iOS 18.0 (22A3354)
iPad Air 3 with iPad OS 17.6.1
My project use manual reference counting and crash with UIAlertController when touch to Action Button:
UIAlertController alert = [[UIAlertController
alertControllerWithTitle:@"fsđs"
message:@"fsđs"
preferredStyle:UIAlertControllerStyleAlert
]autorelease];
UIAlertAction actionOk = [UIAlertAction actionWithTitle:@"Ok"
style:UIAlertActionStyleDefault
handler:nil];
[alert addAction:actionOk];
[self.window.rootViewController presentViewController:alert animated:YES
completion:^{
}];
I have a bug in my app that happens when the app is "offline" without and internet connection. The app should still work as it stores content locally. However I am struggling to debug the issue because turning off WiFi breaks the connection to the Xcode debugger, even though it is plugged in via USB.
Did I turn on some setting to debug over WiFi? How do I debug over USB so I can see the log output without a network connection to the iPhone?
My app crashes when a button is pressed, however only on a small percentage of devices. I can't reproduce it on my end, but I have a crash log from a TestFlight user. Any thoughts on what this crash log could be indicating?
crashlog.crash
I'm debugging ios app using Automatic Assessment configuration entitlement with ipad. However, while repeatedly running and stopping the app, it crashed during the assessment mode, and now the ipad doesn't work. Because it might be under the assessment mode, I cannot return to the home screen and cannot uninstall the app. Additionally, even when I try to redo the debugging process, it remains stuck on the "installing" stage in xcode, and my iPad is unresponsive. I am unable to force quit it. Is there a way to recover my iPad?
My app needs to send iMessages with an attached data file. The view comes up modally and the user needs to press the send button. When the button is tapped the error occurs and the attachment and message is not delivered.
I have tried three implementations of UIViewControllerRepresentable for MFMessageComposeViewController that have worked for iOS 15 and 16, but not 17. If I make the simplest app to show the problem, it will reliably fail on all iOS versions tested.
If I remove the attachment, the message gets sent. In contrast, the equivalent UIViewControllerRepresentable for email works perfectly every time. After struggling for weeks to get it to work, I am beginning to believe this is a timing error in iOS. I have even tried unsuccessfully to include dispatch queue delays.
Has anybody else written a swiftUI based app that can reliably attach a file to an iMessage send?
UIViewControllerRepresentable:
import SwiftUI
import MessageUI
import UniformTypeIdentifiers
struct AttachmentData: Codable {
var data:Data
var mimeType:UTType
var fileName:String
}
struct MessageView: UIViewControllerRepresentable {
@Environment(\.presentationMode) var presentation
@Binding var recipients:[String]
@Binding var body: String
@Binding var attachments:[AttachmentData]
@Binding var result: Result<MessageComposeResult, Error>?
func makeUIViewController(context: Context) -> MFMessageComposeViewController {
let vc = MFMessageComposeViewController()
print("canSendAttachments = \(MFMessageComposeViewController.canSendAttachments())")
vc.recipients = recipients
vc.body = body
vc.messageComposeDelegate = context.coordinator
for attachment in attachments {
vc.addAttachmentData(attachment.data, typeIdentifier: attachment.mimeType.identifier, filename: attachment.fileName)
}
return vc
}
func updateUIViewController(_ uiViewController: MFMessageComposeViewController, context: Context) {
}
func makeCoordinator() -> Coordinator {
return Coordinator(presentation: presentation, result: $result)
}
class Coordinator: NSObject, MFMessageComposeViewControllerDelegate {
@Binding var presentation: PresentationMode
@Binding var result: Result<MessageComposeResult, Error>?
init(presentation: Binding<PresentationMode>, result: Binding<Result<MessageComposeResult, Error>?>) {
_presentation = presentation
_result = result
}
func messageComposeViewController(_ controller: MFMessageComposeViewController, didFinishWith result: MessageComposeResult) {
defer {
$presentation.wrappedValue.dismiss()
}
switch result {
case .cancelled:
print("Message cancelled")
self.result = .success(result)
case .sent:
print("Message sent")
self.result = .success(result)
case .failed:
print("Failed to send")
self.result = .success(result)
@unknown default:
fatalError()
}
}
}
}
SwiftUI interface:
import SwiftUI
import MessageUI
struct ContentView: View {
@State private var isShowingMessages = false
@State private var recipients = ["4085551212"]
@State private var message = "Hello from California"
@State private var attachment = [AttachmentData(data: Data("it is not zip format, however iMessage won't allow the recipient to open it if extension is not a well-known extension, like .zip".utf8), mimeType: .zip, fileName: "test1.zip")]
@State var result: Result<MessageComposeResult, Error>? = nil
var body: some View {
VStack {
Button {
isShowingMessages.toggle()
} label: {
Text("Show Messages")
}
.sheet(isPresented: $isShowingMessages) {
MessageView(recipients: $recipients, body: $message, attachments: $attachment, result: $result)
}
.onChange(of: isShowingMessages) { newValue in
if !isShowingMessages {
switch result {
case .success(let type):
switch type {
case .cancelled:
print("canceled")
break
case .sent:
print("sent")
default:
break
}
default:
break
}
}
}
}
}
}
#Preview {
ContentView()
}
Hi
We are developing a iPad accessory that connects to the USB-C port of an iPad Pro.
For debugging, we are using iPad pro M4 and iPad Pro 12.9 (fifth gen).
We are aware we can debug the app over wifi, but this process is slow and cumbersome.
Is there a USB-C hub ( I guess that supports thunderbolt ) that would allow us to connect the iPad to both our Mac and to the iPad accessory simultaneously ?
Thanks
After the release of iOS17, our app has collected JavaScriptCore crashes, and the crash has recently appeared in iOS17 and above. The number of crashes collected recently is increasing.
The following are several complete crash log information. Currently, crashes are only collected on iOS17 and above systems.
2024-05-08_20-45-00.5216_+0800-fdb980f66f56d73b944ccc3466922d7fd0690089.crash
2024-05-11_02-42-46.0303_+0800-5ea1f23ba38c4782b80bd6304a9625e305c296a2.crash
2024-05-13_14-30-03.2084_+0800-d9598b08a153f5214b51257400423d4079049578.crash
Translate the complete passage into English: "When using xctrace to record mobile process performance parameters, it happens that long duration recordings (exceeding about 20 minutes) result in the trace file missing some information, as shown in the diagram. However, there is no issue when recording directly with the instrument on the problematic machine. Now, using xctrace for recording for over 20 minutes almost certainly causes this problem. The macOS versions are all 12.5.1, and the processors are M1 and Intel Core i7, respectively. Additionally, the Xcode versions are all 13.4 (13F17a). There is no problem with short recording durations. Only when it records for a longer period does it result in nearly all data being lost. The situation is pretty much the same with the other templates as well.
I have an app that uses FrameworkA and FrameworkB.
FrameworkA is simple, i.e., no dependencies.
FrameworkB includes FrameworkA, which is normal. But it also uses pieces of FrameworkA's public interface in its own public interface. Yes, I find that a bit odd... (I didn't make those frameworks... just trying to sort out things...)
Now I am trying to enable Xcode's module verifier for FrameworkB and the problem begins...
FrameworkB can no longer have
#import <FrameworkA/FramworkASomethingSomething.h>
in its public headers.
The modulemap file for FrameworkB currently looks like
framework module FrameworkB {
umbrella header "FrameworkB.h"
export *
module * { export * }
}
Is it possible still use FrameworkA's public interface in FrameworkB's public interface?
And if yes, how is that sorted out in the modulemap?
So far I have tried
framework module FrameworkB {
umbrella header "FrameworkB.h"
export *
module * { export * }
link framework "FrameworkA"
module FrameworkA [system] {
umbrella header "FrameworkA.h"
export *
}
}
But it gives the error
Umbrella header 'FrameworkA.h' not found
Thanks!
I've downloaded xcode beta and from then I'm not able to see any messages in the debugger console. I only see the: "Message from debugger: killed" after stopping it.
I tried downgrading it but since I'm using Sequoia Beta, "normal" xcode won't be compatible with this MacOs version.
This is what I have:
xcode Version 16.1 beta (16B5001e)
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: x86_64-apple-darwin24.0.0
lldb-1500.0.404.7
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
xcode-select version 2409.
package-id: com.apple.pkg.CLTools_Executables
version: 15.3.0.0.1.1708646388
volume: /
location: /
install-time: 1725364937
It can be a mess as I tried so many ways to make this work.
Thanks in advance.
Regards.