Debugging

RSS for tag

Discover and resolve issues with your app.

Posts under Debugging tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

The compiler is unable to type-check this expression in reasonable time
This is one of the worst errors you can encounter while developing with Xcode. It looks like it's related to a problem inside the compiler itself: when there are lot of lines of code, it becomes unable to identify them all and start asking you to break down the code in smaller pieces. Sometimes you can, sometimes not. First of all, in your code there is FOR SURE an error, so in case of the second option, begin commenting entires sections of your code: this can lead to two options: You commented a section that contains the error: Xcode give you the preview and you check the commented section to find the error You commented enough code to let the compiler do its job, and you'll have the normal error reported in your code: again, fix it! Once errors have been fixed, normally you can uncomment what you excluded and all will go up and ok again. The most common errors that can lead to this behavior (but it's just a hint) are those involving parameters got or passed to other SwiftUI objects: parameters label (mistyped, missing, exceeding) parameters values (not $/& present, $/& present but not required) parameters types (you passed a wrong type) Well, I hope that this post could be useful to others that, like I did, are struggling a lot to understand the exact nature of this peculiar error. Code well and Prosper!
0
1
192
Oct ’24
iOS 18.0.1 - SafariViewService - LIBXPC - XPC_EXIT_REASON_FAULT
Title: SafariViewService Recurring "Hard Refresh" Issue on iOS 18.0.1 Hello, Many of my app users are experiencing a recurring "hard refresh" issue related to SafariViewService, which appears only on iOS 18.0.1 across various iPhone models. Users on earlier iOS versions are not encountering this problem. Our app relies on SafariViewService, and the logs show an event triggered by an EXC_GUARD exception with a termination reason from LIBXPC, causing the app to stop. Below are key details from the log report: App Version: 4.1.2 (build 4.1.1.0) OS Version: iPhone OS 18.0.1 Exception Type: EXC_GUARD Subtype: GUARD_TYPE_USER Termination Reason: LIBXPC, XPC_EXIT_REASON_FAULT Device Model: iPhone 11 Pro Max Process Path: [Removed] Here’s an excerpt from the logs: ... {"codes":"0x6000000000000007, 0x0000000000000009","reason":9,"message":"namespc 7 reason_code 0x0000000000000009","subtype":"GUARD_TYPE_USER","type":"EXC_GUARD","rawCodes":[Removed],"namespc":7}, "termination" : {"flags":518,"code":9,"namespace":"LIBXPC","indicator":"XPC_EXIT_REASON_FAULT"}, ... I would greatly appreciate any guidance on resolving this issue, particularly if there are known concerns with inter-process communication (LIBXPC) in iOS 18.0.1 or advice on how to manage the EXC_GUARD exception more effectively. Full log details are in the attachment. Thank you for your help! ExcUserFault_SafariViewService-2024-10-10-102717 (1).ips ExcUserFault_OnixWorker.Maui-2024-10-10-102718 (1).ips Thank you for your help!
0
8
520
Oct ’24
Please HELP. - UIViewController dealloc bug. I need help!
Dear Senior Developer, I come to you at a time where I am lost. Over the last 2-3 months, I have noticed a series of crashes occuring on my app. This all started randomly and has now been a regular occurence. Usually, I would receive some detail as it relates to some class or view that is causing this error but now the only details I have is it relates to a UiViewController dealloc even though I am using SwiftUI. Below I have attached the stack trace from firebase crash analytics. I have spent months on this and I am asking for the help of someone much more senior and knowledable to assist me in this regard. Thanks again for your help and I await your response. I am also willing to share my screen LIVE to help you help me identify this issue. manny.GoblinTools_issue_bfd18ee65a92b459d4ecef3475a9ec34_crash_session_032166c28b8c4764b13a6fdca636d2d6_DNE_0_v2_stacktrace.txt
2
0
230
1h
Xcode | how to debug with iPhone in LAN
We're developing iOS apps on Xcode. Because of the rules, **our computers can't get online or connect to real devices through USB. ** But we can connect to the internal cloud real-device platform through the internal network. The cloud real-device platform is actually some centrally managed iPhones or iPads (not through simple Wi-Fi but a wired network). We can now remotely operate these phones for testing (though there's quite a lot of lag), but for development, we hope to be able to use these phones for debugging, like ADB. That would improve efficiency a lot. According to the feedback, the lower versions of Xcode and phones can achieve this function through USBMuxD, but for iOS 17, Xcode 15 and the newer versions, it can't be done for now. Here are two questions: Is there a management plan for iPhone cloud real devices? We hope to be able to use the cloud real devices smoothly in the local area network. Is there a plan for Xcode to debug real devices through the local area network instead of relying on Wi-Fi? Thanks
0
0
195
Oct ’24
Crashes with error EXC_BAD_ACCESS (code=2, ...) after Xcode and Device Upgrade
I have been developped this app for almost three years. It worked perfectly fine till I changed my phone to iPhone 16 and upgraded my xcode to the latest version (Version 16.0 (16A242d)). After the app finish building, the app will crash automatically when open. I had this onboarding page to be presented at the very beginning, simple image with an action button. The app kept breaking, and I found the Thread indicating error with ActionLabelView (Thread 1: EXC_BAD_ACCESS (code=2, address=0x16d107fa0)). I commented out the button on my app's onboarding page once, the app could run but to the next step will need the button. The code should be fine I believe, cuz nothing like this ever came up with my old phone and old xcode version. Could some one please help?
1
0
196
Oct ’24
Not getting crash logs for TestFlight builds
Hello, We haven't been getting crash logs for internal TestFlight builds. I've tried intentionally causing a crash by calling fatalError() directly. The TestFlight feedback dialog appears and crash logs appear on the iPhone device itself, but they never appear in App Store Connect or Xcode Organizer. The builds are all created by an Xcode cloud workflow and the Share analytics with App Developers setting is on. I filed a radar ticket at FB15453505, but I wonder if others might have run into the same thing. Has anyone else had this issue and figured out how to resolve it?
2
1
239
3w
Re-register device in Platform SSO
Hi, I'm currently in the middle of debugging between my macOS and server for implementing Platform SSO. As part of the debug process, I sometimes want to restart the whole process, which means to get into the beginDeviceRegisteration method again. I noticed that even if I push the Repair button in the user (under settings) it will go again and again into the beginUserRegistration, but it will not go again to the device registration. Is there an option to reset the Platform SSO device registration? (already tried Repair, remove MDM profile of the PSSO etc.)
1
0
382
Oct ’24
TabView with TabSection crashing on iPad
We have an iPad app and are using the new TabView and TabSection views in our sidebar. The TabSection is populated with data from a @FetchRequest that fetches data from CoreData. The data in CoreData is updated by a single worker that makes sure every value only exists once. This is done by using an OperationQueue with maxConcurrentOperationCount set to 1. This is crashing for our users, and we can't figure out why. We can't reproduce it, and it only seems to happen on iPadOS. We have the same code running on macOS and haven't received any reports. (We collect them all via 3rd party). The error is: NSInternalInconsistencyException Fatal: supplied item identifiers are not unique. Duplicate identifiers: {( ... )} Where ... is one to many comma separated strings. In our latest update we made sure the values are unique by passing them through a Set, unfortunately this is till crashing. Here's the fix we tried. var uniqueTags: [HashTag] { let set = Set(hashTags) let array = Array(set) return array.sorted { $0.name?.lowercased() ?? "" < $1.name?.lowercased() ?? "" } } We're out of ideas and have no idea what to do next.
4
3
280
1w
GPS Icon Appears on App Launch Despite No CLLocationManager Usage – Need Help Tracing Cause
Hello everyone, I’m facing an issue with my iOS app where the GPS/location services icon appears in the status bar immediately when the app is launched, even though I’m not intentionally accessing location services at that point. Issue Summary: • GPS Icon Activation: When I launch my app, the GPS icon turns on. It turns off when the app is minimized or closed. • No Intentional Location Usage at Launch: I have ensured that no instances of CLLocationManager are created when the app is launched. What I’ve Tried So Far: 1. Checked Controllers and Related Classes: • Reviewed all the code for the controllers that are active at launch. • Verified that none of these controllers create instances of CLLocationManager or call location-related methods. 2. Commented Out startUpdatingLocation: • Commented out all calls to startUpdatingLocation throughout the entire project. 3. Ensured No CLLocationManager Instances at Launch: • Searched for any code that might instantiate CLLocationManager during app launch. • Confirmed that no such instances are being created. 4. Commented Out Google Maps SDK Configuration: • In AppDelegate, commented out the Google Maps SDK configuration, so it’s not initialized with the API key. • No map views (GMSMapView, MKMapView) are initialized or used when the app is launched. 5. Tested Location Permissions: • When I change the location permission for the app to “Never” in the Settings app, the GPS icon does not appear upon app launch. • This suggests that the app is accessing location services when it has permission, even though I haven’t explicitly requested it at launch. Objective: • Control GPS Activation: I want to ensure that the GPS does not turn on when the app is launched. I intend to activate location services only when needed later in the app. Request for Assistance: I’m seeking guidance on the following: 1. Debugging Techniques: • How can I trace the code that’s causing the GPS to turn on at app launch? • Are there tools or methods to identify hidden or indirect calls to location services? 2. Forcing Location Services Off at Launch: • Is there a way to programmatically prevent location services from activating during app launch? • Can I defer any implicit location service initialization until I explicitly enable it? 3. Potential Hidden Triggers: • Are there known scenarios where location services could be activated without direct use of CLLocationManager? • Could frameworks like Google Maps SDK trigger location services even if not fully initialized? 4. Additional Suggestions: • Any other insights or suggestions to prevent the GPS icon from appearing on app launch. Additional Information: • Third-Party Frameworks: • I have not removed third-party frameworks yet, as I wanted to check other possibilities first. • Open to the idea that a third-party framework might be causing this, but need guidance on how to confirm. • Code Availability: • I’m happy to provide specific code snippets if that would help diagnose the issue. Environment: • Xcode Version: Xcode 15.4, Xcode 16.0 • iOS Deployment Target: iOS 15.0 • Devices Tested: iPhone SE 2nd and 3rd gen, iPhone 15, iPhone 15 pro, iPhone 11 • Programming Language: Swift What I’m Looking For: • Assistance in tracing the cause of the GPS activation on app launch. • Suggestions on how to prevent location services from starting until explicitly needed. • Insights into any hidden triggers or indirect usages that might cause this behavior. Thank you for your time and assistance. Any help to resolve this issue would be greatly appreciated.
1
1
214
Oct ’24
Guideline 2.1 - Performance - App Completeness We were unable to review the app because it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue. Review device details: - Device type: iPad Air (5th generation)
Hi, I developed an app. It is using Firebase Cloud Messaging to send notifications. I got my 5th rejection from Apple. I tried to distribute the app from Xcode with new Provisining Profile and Certificates but it go rejected. I used EAS to distribute it automatically but 5 minutes ago it is again rejected. I tried on iPhone and iPad simulators, it is working perfectly fine. Even sending notifications are working perfect. Please can you help me? My crash reports are : crash1 crash2 crash3
1
0
218
Oct ’24
Navigation Bar Elements Disappear When Using UIPageViewController in SwiftUI Under Low Power Mode
Problem Description: In a SwiftUI application, I've wrapped UIKit's UIPageViewController using UIViewControllerRepresentable, naming the wrapped class PagedInfiniteScrollView. This component causes navigation bar elements (title and buttons) to disappear. This issue only occurs in Low Power Mode on a physical device. Steps to Reproduce: Enable Low Power Mode on a physical device and open the app's home page. From the home page, open a detail sheet containing PagedInfiniteScrollView. This detail page include a navigation title and a toolbar button in the top-right corner. PagedInfiniteScrollView supports horizontal swiping to switch pages. Tap the toolbar button in the top-right corner of the detail page to open an edit sheet. Without making any changes, close the edit sheet and return to the detail page. On the detail page, swipe left and right on the PagedInfiniteScrollView. Expected Result: When swiping the PagedInfiniteScrollView, the navigation title and top-right toolbar button of the detail page should remain visible. Actual Result: When swiping the PagedInfiniteScrollView, the navigation title and top-right toolbar button of the detail page disappear. import SwiftUI @main struct CalendarApp: App { var body: some Scene { WindowGroup { ContentView() } } } import SwiftUI struct ContentView: View { @State private var showDetailSheet = false @State private var currentPage: Int = 0 var body: some View { NavigationStack { Button { showDetailSheet = true } label: { Text("show Calendar sheet") } .sheet(isPresented: $showDetailSheet) { DetailSheet(currentPage: $currentPage) } } } } struct DetailSheet: View { @Binding var currentPage: Int @State private var showEditSheet = false var body: some View { NavigationStack { PagedInfiniteScrollView(content: { pageIndex in Text("\(pageIndex)") .frame(width: 200, height: 200) .background(Color.blue) }, currentPage: $currentPage) .sheet(isPresented: $showEditSheet, content: { Text("edit") }) .navigationTitle("Detail") .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItemGroup(placement: .topBarTrailing) { Button { showEditSheet = true } label: { Text("Edit") } } } } } } import SwiftUI import UIKit struct PagedInfiniteScrollView<Content: View>: UIViewControllerRepresentable { typealias UIViewControllerType = UIPageViewController let content: (Int) -> Content @Binding var currentPage: Int func makeCoordinator() -> Coordinator { Coordinator(self) } func makeUIViewController(context: Context) -> UIPageViewController { let pageViewController = UIPageViewController(transitionStyle: .scroll, navigationOrientation: .horizontal) pageViewController.dataSource = context.coordinator pageViewController.delegate = context.coordinator let initialViewController = UIHostingController(rootView: IdentifiableContent(index: currentPage, content: { content(currentPage) })) pageViewController.setViewControllers([initialViewController], direction: .forward, animated: false, completion: nil) return pageViewController } func updateUIViewController(_ uiViewController: UIPageViewController, context: Context) { let currentViewController = uiViewController.viewControllers?.first as? UIHostingController<IdentifiableContent<Content>> let currentIndex = currentViewController?.rootView.index ?? 0 if currentPage != currentIndex { let direction: UIPageViewController.NavigationDirection = currentPage > currentIndex ? .forward : .reverse let newViewController = UIHostingController(rootView: IdentifiableContent(index: currentPage, content: { content(currentPage) })) uiViewController.setViewControllers([newViewController], direction: direction, animated: true, completion: nil) } } class Coordinator: NSObject, UIPageViewControllerDataSource, UIPageViewControllerDelegate { var parent: PagedInfiniteScrollView init(_ parent: PagedInfiniteScrollView) { self.parent = parent } func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? { guard let currentView = viewController as? UIHostingController<IdentifiableContent<Content>>, let currentIndex = currentView.rootView.index as Int? else { return nil } let previousIndex = currentIndex - 1 return UIHostingController(rootView: IdentifiableContent(index: previousIndex, content: { parent.content(previousIndex) })) } func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? { guard let currentView = viewController as? UIHostingController<IdentifiableContent<Content>>, let currentIndex = currentView.rootView.index as Int? else { return nil } let nextIndex = currentIndex + 1 return UIHostingController(rootView: IdentifiableContent(index: nextIndex, content: { parent.content(nextIndex) })) } func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { if completed, let currentView = pageViewController.viewControllers?.first as? UIHostingController<IdentifiableContent<Content>>, let currentIndex = currentView.rootView.index as Int? { parent.currentPage = currentIndex } } } } extension PagedInfiniteScrollView { struct IdentifiableContent<Content: View>: View { let index: Int let content: Content init(index: Int, @ViewBuilder content: () -> Content) { self.index = index self.content = content() } var body: some View { content } } }
3
0
227
Oct ’24
SwiftUI iOS18 Bug: 'contextMenu' does not recognize 'scaleEffect' and similar outside of 'ScrollView' parent
The Issue I am building a MessageChannelView, I take most advantage of all ScrollView mechanics by flipping it on it's head with .scaleEffect(y: -1), and then the content inside of it again with .scaleEffect(y: -1), so the content is back to normal. Putting .contextMenu() on any of the elements flipped back to normality will cause an ugly bug on iOS18, but not on iOS17. This is because .contextMenu() on iOS18 does not recognize the .scaleEffect(y: -1) outside of it's ScrollView parent. Minimal Replication 1.) Create any View with SwiftUI similar to this: ScrollViewReader { scrollView in ScrollView { VStack { Text("Test!") .contextMenu { Button(action: {}) { Label("Copy Link", systemImage: "doc.on.doc") } } } .scaleEffect(y: -1) } .scaleEffect(y: -1) } 2.) Run on a physical device with iOS18 More I tested this on three different physical iPhone devices, iOS16, iOS17 and my main device iOS18. The bug only exists on iOS18.
1
1
247
Oct ’24
NSApplicationDelegate open URLs only called after second drop
I want to make a simple droplet application. I've set the document types to include com.adobe.pdf files, and I am now receiving callbacks to the app delegate's application(_:open:) callback when I drop PDFs on the app icon… But not the first time. It doesn't matter how long I wait, or whether the app is already open—the first drop never triggers the callback. All subequent drops work as expected, and I get URLs to all the files dropped. What might be wrong? How can I debug this?
1
0
281
Oct ’24
Application Got Crash in IOS 18 device
Can anyone help me to resolve this issue? I have two collectionviews in a tableview and each time you try to scroll the collecctionview after clicking a cell, it crashes with the following error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. For retrieving an existing view in the collection view, use -[UICollectionView cellForItemAtIndexPath:] or -[UICollectionView supplementaryViewForElementKind:atIndexPath:]
2
1
839
Oct ’24
Unexpected crash app Pokerstars
Any help? Translated Report (Full Report Below) Process: PokerStars [2219] Path: /Applications/PokerStars.app/Contents/MacOS/PokerStars Identifier: com.pokerstars.PokerStars Version: 70.813 (70.813) Code Type: X86-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2024-09-30 11:40:02.5034 +0200 OS Version: macOS 15.0 (24A335) Report Version: 12 Bridge OS Version: 9.0 (22P353) Anonymous UUID: 4748D711-22F5-94D6-9366-54F5DEB78692 Time Awake Since Boot: 2800 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x000000017f7cb461 Exception Codes: 0x0000000000000001, 0x000000017f7cb461 Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: exc handler [2219] VM Region Info: 0x17f7cb461 is not in any region. Bytes after previous region: 1385022562 Bytes before following region: 105546682420127 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL CG raster data 12c800000-12ceef000 [ 7100K] r--/r-- SM=COW ---&gt; GAP OF 0x5ffed3111000 BYTES MALLOC_NANO 600000000000-600020000000 [512.0M] rw-/rwx SM=PRV
1
0
166
Oct ’24
Non-XCode crash logging for iOS?
I test my app, by building it and hoping it will go on my iOS. This is the only workflow I have to test my testing app. I use AVAudioEngine and AVAudioSession. It sounds painful but, yes. I literally comment out parts and build the app everytime and see if it would crash or not. Sometimes I'd get Crash Logs in the Analytics part, but I haven't managed to get them there anymore. So I had no more Crash Logs. I was wondering if there's a function or something. Maybe something that I can do in AppDelegate to make it create a Crash Log somewhere? Uncaught Exception overwrite, didn't solve the issue for me. It really has to be an actual crash log, something that catches these. If someone knows, let me know! Thanks
1
0
244
Sep ’24
TestFlight Stuck on Redeem Code Page, Unable to Access Beta Apps or Builds on iPhone
I am currently facing an issue with the TestFlight app on my iPhone, where I am stuck on the redeem code page and unable to access the apps I am testing. Interestingly, I am able to access TestFlight without any issues on my MacBook (MacOS), but the problem persists only on iOS. Here is a detailed breakdown of the issue: Issue Description: Upon opening TestFlight on my iPhone, I am immediately directed to a redeem code page with no option to exit or view the main screen, where I should see the apps and builds I am testing. Steps to Reproduce: 1. Open TestFlight on iPhone. 2. TestFlight opens directly to the redeem code page with no option to access other parts of the app. 3. Enter a valid redeem code (used immediately after receiving it). 4. Receive an error message stating the code is invalid or expired. 5. Attempt to access TestFlight via an email invitation link, but it redirects back to the redeem code page. Expected Result: I expect to see TestFlight’s homepage with all the apps and builds I am currently testing. Actual Result: I am stuck on the redeem code page with no option to exit, and valid redeem codes are not being accepted. I have tried using new codes, accessing the app via email invitations, and reinstalling the app, but the issue continues. Any help or guidance on how to fix this would be greatly appreciated.
0
1
356
Sep ’24