Debugging

RSS for tag

Discover and resolve issues with your app.

Pinned Posts

Posts under Debugging tag

475 Posts
Sort by:
Post not yet marked as solved
4 Replies
5.6k Views
I did not have this issue in Xcode version 14.2, but I am getting it in Xcode 14.3. I added all of the Firebase packages and I know that FirebaseFirestore is, in fact, part of the package.
Posted
by
Post not yet marked as solved
2 Replies
1.7k Views
Crash - 1: Fatal Exception: NSRangeException 0 CoreFoundation 0x9e38 __exceptionPreprocess 1 libobjc.A.dylib 0x178d8 objc_exception_throw 2 CoreFoundation 0x1af078 -[__NSCFString characterAtIndex:].cold.1 3 CoreFoundation 0x1a44c -[CFPrefsPlistSource synchronize] 4 UIKitCore 0x1075f68 -[UIPredictionViewController predictionView:didSelectCandidate:] 5 TextInputUI 0x2461c -[TUIPredictionView _didRecognizeTapGesture:] 6 UIKitCore 0xbe180 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] 7 UIKitCore 0x42c050 _UIGestureRecognizerSendTargetActions 8 UIKitCore 0x1a5a18 _UIGestureRecognizerSendActions 9 UIKitCore 0x86274 -[UIGestureRecognizer _updateGestureForActiveEvents] 10 UIKitCore 0x132348 _UIGestureEnvironmentUpdate 11 UIKitCore 0x9ba418 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] 12 UIKitCore 0xf6df4 -[UIGestureEnvironment _updateForEvent:window:] 13 UIKitCore 0xfb760 -[UIWindow sendEvent:] 14 UIKitCore 0xfaa20 -[UIApplication sendEvent:] 15 UIKitCore 0xfa0d8 __dispatchPreprocessedEventFromEventQueue 16 UIKitCore 0x141e00 __processEventQueue 17 UIKitCore 0x44a4f0 __eventFetcherSourceCallback 18 CoreFoundation 0xd5f24 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION 19 CoreFoundation 0xe22fc __CFRunLoopDoSource0 20 CoreFoundation 0x661c0 __CFRunLoopDoSources0 21 CoreFoundation 0x7bb7c __CFRunLoopRun 22 CoreFoundation 0x80eb0 CFRunLoopRunSpecific 23 GraphicsServices 0x1368 GSEventRunModal 24 UIKitCore 0x3a1668 -[UIApplication _run] 25 UIKitCore 0x3a12cc UIApplicationMain ============================================================ Crash - 2: Crashed: com.apple.root.background-qos 0 libobjc.A.dylib 0x1c20 objc_msgSend + 32 1 UIKitCore 0xb0e0d8 __37-[UIDictationConnection cancelSpeech]_block_invoke + 152 2 libdispatch.dylib 0x24b4 _dispatch_call_block_and_release + 32 3 libdispatch.dylib 0x3fdc _dispatch_client_callout + 20 4 libdispatch.dylib 0x15b8c _dispatch_root_queue_drain + 684 5 libdispatch.dylib 0x16284 _dispatch_worker_thread2 + 164 6 libsystem_pthread.dylib 0xdbc _pthread_wqthread + 228 7 libsystem_pthread.dylib 0xb98 start_wqthread + 8 ============================================================ I encountered the two keyboard-related crashes in iOS 16.x, but I cannot reproduce them. Can anyone tell me what is going on and how to fix them? Please let me know.
Posted
by
Post not yet marked as solved
12 Replies
1.5k Views
Hi, ALL, I' have a Mac laptop with OSX 10.13 and Xcode 9. I am trying to develop a cross-platform C++ application using wxWidgets. It builds fine and I can successfully run it from the Terminal with "open myapp.app". However, trying to Run/Debug the application from inside Xcode fails - the application is crashing. Could someone please help me to run/debug the application from inside the Xcode? If needed - I can give a link to the GitHub Thank you in advance.
Posted
by
Post not yet marked as solved
0 Replies
365 Views
I have a few swift codes to share that others may want I was trying to compile swift playgrounds programs on my iPhone I am interested in making an App for it possibly it has been a long time since I used a MAC First Code…Swift Compiler import subprocess def compile_swift_code(code): try: # Write the Swift code to a temporary file with open('temp.swift', 'w') as file: file.write(code) # Compile the Swift code using the subprocess module subprocess.run(['swiftc', '-o', 'output', 'temp.swift'], check=True) # Execute the compiled program and capture the output completed_process = subprocess.run(['./output'], capture_output=True, text=True) output = completed_process.stdout return output.strip() except subprocess.CalledProcessError as e: print("Compilation error:", e) return None Example usage swift_code = ''' print("Hello, world!") ''' output = compile_swift_code(swift_code) if output is not None: print(output) Second Code example program that simulates the expansion of the universe from the Big Bang to the present day using N-body simulations and the Friedmann equations in swift playgrounds code import UIKit import SceneKit import PlaygroundSupport import simd // Constants let c: Double = 299792.458 // speed of light in km/s let H0: Double = 70 // Hubble constant in km/s/Mpc let G: Double = 6.6743e-11 // gravitational constant in m^3/kg/s^2 let rho_crit: Double = 1.878e-26 // critical density of the universe in kg/m^3 // Parameters let N: Int = 1000 // number of particles let t0: Double = 0 // initial time in Gyr let tf: Double = 13.8 // final time in Gyr let dt: Double = 0.01 // time step in Gyr let a0: Double = 1 / (1 + t0 * H0 / 2997.92) // initial scale factor // Generate initial conditions var x = (0..<N).map { _ in return simd_double3(Double.random(in: -10..<10), Double.random(in: -10..<10), Double.random(in: -10..<10)) } var v = (0..<N).map { _ in return simd_double3(Double.random(in: -100..<100), Double.random(in: -100..<100), Double.random(in: -100..<100)) } var m = (0..<N).map { _ in return Double.random(in: 1e11..<1.1e11) } // Define Friedmann equations func HubbleParameter(a: Double) -> Double { return H0 * sqrt((rho_crit / 3) * (1 / pow(a, 3))) } func Acceleration(x: [simd_double3], v: [simd_double3]) -> [simd_double3] { let r = x.map { return length($0) } var a = [simd_double3](repeating: simd_double3(0), count: N) for i in 0..<N { a[i] = -G * (x[i] / pow(r[i], 3)) * m a[i] -= HubbleParameter(a: 1) * x[i] } return a } // Initialize arrays for storing data var t = stride(from: t0, to: tf, by: dt).map { return $0 } var a = [Double](repeating: 0, count: t.count) var v = [simd_double3](repeating: simd_double3(0), count: N) var x = [simd_double3](repeating: simd_double3(0), count: N) // Set initial conditions a[0] = a0 v[0] = v[0] x[0] = x[0] // Integrate equations of motion using Verlet algorithm for i in 1..<t.count { x[i] = x[i-1] + v[i-1] * dt + 0.5 * Acceleration(x: x, v: v)[i-1] * dt * dt a[i] = a0 * (1 + HubbleParameter(a: a0) * (t[i] - t0)) // scale factor as a function of time v[i] = v[i-1] + 0.5 * (Acceleration(x: x, v: v)[i] + Acceleration(x: x, v: v)[i-1]) * dt } // Plot results I have a few more codes and some new engine/motor designs
Posted
by
Post not yet marked as solved
0 Replies
367 Views
Device: iPhoneX OS: 16.3.1 App Crash: Fatal Exception: NSInvalidArgumentException 0 CoreFoundation 0x9a24 __exceptionPreprocess 1 libobjc.A.dylib 0x15958 objc_exception_throw 2 CoreFoundation 0x197524 -[__NSCFString characterAtIndex:].cold.1 3 CoreFoundation 0x1965c8 -[__NSPlaceholderSet initWithCapacity:].cold.1 4 CoreFoundation 0x2232c -[__NSPlaceholderSet initWithObjects:count:] 5 CoreFoundation 0x214b0 __createSet 6 CoreFoundation 0x67a24 +[NSSet setWithObject:] 7 UIKitCore 0xe02eac -[UITextSelectionInteraction tapAndAHalf:] 8 UIKitCore 0xb5de4 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] 9 UIKitCore 0x3f9a24 _UIGestureRecognizerSendTargetActions 10 UIKitCore 0x192c38 _UIGestureRecognizerSendActions 11 UIKitCore 0x805dc -[UIGestureRecognizer _updateGestureForActiveEvents] 12 UIKitCore 0x124a54 _UIGestureEnvironmentUpdate 13 UIKitCore 0x929188 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] 14 UIKitCore 0xebf60 -[UIGestureEnvironment _updateForEvent:window:] 15 UIKitCore 0xf08bc -[UIWindow sendEvent:] 16 UIKitCore 0xefbb8 -[UIApplication sendEvent:] 17 UIKitCore 0xede20 __dispatchPreprocessedEventFromEventQueue 18 UIKitCore 0x133b38 __processEventQueue 19 UIKitCore 0x4170ac __eventFetcherSourceCallback 20 CoreFoundation 0xcc288 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 21 CoreFoundation 0xd7be8 __CFRunLoopDoSource0 22 CoreFoundation 0x61fa0 __CFRunLoopDoSources0 23 CoreFoundation 0x76f74 __CFRunLoopRun 24 CoreFoundation 0x7bb48 CFRunLoopRunSpecific 25 GraphicsServices 0x1984 GSEventRunModal 26 UIKitCore 0x375638 -[UIApplication _run] 27 UIKitCore 0x3752b0 UIApplicationMain 28 Balrog 0x18c5c8 main + 17 (AppDelegate.swift:17) 29 ??? 0x1e80b9df0 (缺少) Crashed: com.google.firebase.crashlytics.ios.exception 0 FirebaseCrashlytics 0x1eea8 FIRCLSProcessRecordAllThreads + 184 1 FirebaseCrashlytics 0x1f288 FIRCLSProcessRecordAllThreads + 1176 2 FirebaseCrashlytics 0x164d4 FIRCLSHandler + 48 3 FirebaseCrashlytics 0x111a8 __FIRCLSExceptionRecord_block_invoke + 92 4 libdispatch.dylib 0x647c8 _dispatch_client_callout + 16 5 libdispatch.dylib 0x46b54 _dispatch_lane_barrier_sync_invoke_and_complete + 52 6 FirebaseCrashlytics 0x101b4 FIRCLSExceptionRecord + 204 7 FirebaseCrashlytics 0x10cc8 FIRCLSExceptionRecordNSException + 452 8 FirebaseCrashlytics 0xfe0c FIRCLSTerminateHandler() + 404 9 libc++abi.dylib 0x10288 std::__terminate(void (*)()) + 16 10 libc++abi.dylib 0x12e1c __cxa_rethrow + 144 11 libobjc.A.dylib 0x1722c objc_exception_rethrow + 40 12 CoreFoundation 0x7bc0c CFRunLoopRunSpecific + 780 13 GraphicsServices 0x1984 GSEventRunModal + 160 14 UIKitCore 0x375638 -[UIApplication _run] + 868 15 UIKitCore 0x3752b0 UIApplicationMain + 312 16 Balrog 0x18c5c8 main + 17 (AppDelegate.swift:17) 17 ??? 0x1e80b9df0 (缺少) jp.co.rakuten.wallet.leverage.rpcReadingQueue 0 libsystem_kernel.dylib 0x1114 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x129e0 mach_msg2_internal + 76 2 libsystem_kernel.dylib 0x12c1c mach_msg_overwrite + 384 3 libsystem_kernel.dylib 0x1608 mach_msg + 20 4 CoreFoundation 0x75f88 __CFRunLoopServiceMachPort + 156 5 CoreFoundation 0x77138 __CFRunLoopRun + 1232 6 CoreFoundation 0x7bb48 CFRunLoopRunSpecific + 584 7 Foundation 0x3e168 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208 8 Balrog 0x2c988 -[RpcTransport doConnect] + 215 (RpcTransport.m:215) 9 libdispatch.dylib 0x63850 _dispatch_call_block_and_release + 24 10 libdispatch.dylib 0x647c8 _dispatch_client_callout + 16 11 libdispatch.dylib 0x3f800 _dispatch_lane_serial_drain$VARIANT$armv81 + 604 12 libdispatch.dylib 0x40290 _dispatch_lane_invoke$VARIANT$armv81 + 380 13 libdispatch.dylib 0x4a000 _dispatch_workloop_worker_thread + 612 14 libsystem_pthread.dylib 0x1b50 _pthread_wqthread + 284 15 libsystem_pthread.dylib 0x167c start_wqthread + 8 com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0x1114 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x129e0 mach_msg2_internal + 76 2 libsystem_kernel.dylib 0x12c1c mach_msg_overwrite + 384 3 libsystem_kernel.dylib 0x1608 mach_msg + 20 4 CoreFoundation 0x75f88 __CFRunLoopServiceMachPort + 156 5 CoreFoundation 0x77138 __CFRunLoopRun + 1232 6 CoreFoundation 0x7bb48 CFRunLoopRunSpecific + 584 7 Foundation 0x3e168 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208 8 Foundation 0x3e064 -[NSRunLoop(NSRunLoop) runUntilDate:] + 60 9 UIKitCore 0x49a4b8 -[UIEventFetcher threadMain] + 424 10 Foundation 0x55ca4 __NSThread__start__ + 704 11 libsystem_pthread.dylib 0x3060 _pthread_start + 116 12 libsystem_pthread.dylib 0x1688 thread_start + 8 com.google.firebase.crashlytics.MachExceptionServer 0 libsystem_kernel.dylib 0x1114 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x129e0 mach_msg2_internal + 76 2 libsystem_kernel.dylib 0x12c1c mach_msg_overwrite + 384 3 libsystem_kernel.dylib 0x1608 mach_msg + 20 4 FirebaseCrashlytics 0x18a50 FIRCLSMachExceptionServer + 108 5 libsystem_pthread.dylib 0x3060 _pthread_start + 116 6 libsystem_pthread.dylib 0x1688 thread_start + 8 It seems UITextSelectionInteraction trigger this crash, Why this happen? Is it associate with system keyboard?
Posted
by
Post not yet marked as solved
5 Replies
1.1k Views
I have been trying to figure this out for days and can't figure it out. I originally thought it was my launch screen, but everything is set up fine. My app keeps getting rejected for the same reason and I need help. See the lastExceptionBacktrace from the log Apple sent me below. "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"}, "asi" : {"libsystem_c.dylib":["abort() called"]}, "lastExceptionBacktrace" : [{"imageOffset":40340,"symbol":"__exceptionPreprocess","symbolLocation":164,"imageIndex":6},{"imageOffset":99280,"symbol":"objc_exception_throw","symbolLocation":60,"imageIndex":15},{"imageOffset":1535240,"symbol":"-[NSException init]","symbolLocation":0,"imageIndex":6},{"imageOffset":9072980,"imageIndex":0},{"imageOffset":9073352,"imageIndex":0},{"imageOffset":8992,"symbol":"_dispatch_call_block_and_release","symbolLocation":32,"imageIndex":16},{"imageOffset":16044,"symbol":"_dispatch_client_callout","symbolLocation":20,"imageIndex":16},{"imageOffset":28556,"symbol":"_dispatch_queue_override_invoke","symbolLocation":788,"imageIndex":16},{"imageOffset":88388,"symbol":"_dispatch_root_queue_drain","symbolLocation":396,"imageIndex":16},{"imageOffset":90456,"symbol":"_dispatch_worker_thread2","symbolLocation":164,"imageIndex":16},{"imageOffset":3488,"symbol":"_pthread_wqthread","symbolLocation":228,"imageIndex":10},{"imageOffset":2940,"symbol":"start_wqthread","symbolLocation":8,"imageIndex":10}]
Posted
by
Post not yet marked as solved
1 Replies
294 Views
I am developing an IPAD application for IOS 15 on a macOS Ventura 13.3.1 (a) and with an XCode Version 14.3 (14E222b). When I launch the application in the simulator it starts the application but then the black screen appears on the simulator, but it does not return any error, the application works but with the black screen. I put a part of the code for you... import SwiftUI @main class MyApp { static func main() { UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, NSStringFromClass(AppDelegate.self)) } } And here another part (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //-- si no ha creat la finestra if (self.window == nil){ // Create and configure the UIWindow instance // A CGRect is a struct with an origin (x, y) and a size (width, height) CGRect winFrame = [[ UIScreen mainScreen] bounds]; UIWindow theWindow = [[ UIWindow alloc] initWithFrame:winFrame]; self.window = theWindow; // [theWindow release]; } //-- posam la base de dades a on toca [self inicializacion]; //-- arrancam les vistes TWNIndex oVista = [[TWNIndex alloc] init]; TWNNavController* oControler = [[TWNNavController alloc] initWithRootViewController:oVista]; [oVista release]; self.window.rootViewController = oControler; [oControler release]; // Override point for customization after application launch. [self.window makeKeyAndVisible]; //-- Registram un observador [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(siSincronizarDatos:) name:@"TEINORsiSincronizarDatos" object:nil]; //-- que es vegi la bateria i altres informacions /* [application setStatusBarHidden:NO]; [application setStatusBarStyle:UIStatusBarStyleLightContent]; */ //-- continuam return YES; } What is the problem?
Posted
by
Post not yet marked as solved
0 Replies
279 Views
I am running on Xcode version 14.2 on a plugged in iOS device. The target output is giving mostly constraint/styling errors. (shown below) **Will attempt to recover by breaking constraint <NSLayoutConstraint: [...] > Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.** I don't care about these warnings, but when I change to the debugger output, there is nothing. Why is this?
Posted
by
Post not yet marked as solved
1 Replies
422 Views
Hi, i was testing my app using simulator and everything is working fine, but as soon i tried to archive it and installing directly on my phone the app crashed. I tried also using Testflight and it happened the same. Below you can find the full error log that i am getting, can you help me understand the problem? this is the error log: https://www.dropbox.com/s/yu16v0ue5sqhfgu/error%20log.rtf?dl=0
Posted
by
Post marked as solved
2 Replies
237 Views
Hi Everyone, my app is no longer working, when any user tries to open the app, they get the following message "Your app version is no longer compliant. Please update it." There are two options - Update or Exit. Clicking on Update takes me to the app store, but there are no new versions available. The last app update was about 7 months ago and this started happening about a month back. Has anyone else run into this issue before? Thanks
Posted
by
Post not yet marked as solved
1 Replies
355 Views
Suddenly a weird bug started piling up on my crashlitics It was occurring in the webview runJavaScriptAlertPanelWithMessage{ let alertController = UIAlertController(title: "", message: message, preferredStyle: .alert) alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action) in completionHandler() })) self.present(alertController, animated: true, completion: nil) } this simple method To reproduce the bug, kill the app from memory while the notification window is open. NSInternalInconsistencyException - Completion handler was not call will occur Strangely, there was no problem when running in the same way on iOS 16.1, and bugs started to accumulate from version 16.4.1. Does anyone know anything about this part?
Posted
by
Post not yet marked as solved
0 Replies
330 Views
Hello, I'm developing an iOS application in Swift, where I use WKWebView to display web content. Until iOS 16.1, there were no issues, but starting from iOS 16.4.1, I encounter an "NSInternalInconsistencyException - Completion handler was not call" exception when the app transitions to terminated while a UIAlertController is still open. Here's a snippet of the relevant code: func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -&gt; Void) { let alertController = UIAlertController(title: "", message: message, preferredStyle: .alert) alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: { (action) in completionHandler() })) self.present(alertController, animated: true, completion: nil) } If anyone is familiar with this issue or could suggest a way to resolve it, your assistance would be greatly appreciated. Thank you.
Posted
by
Post not yet marked as solved
1 Replies
659 Views
Our app crashes intermittently when calling performSegue(withIdentifier:,sender:). The segue does exist, as most of the time it works fine. The destination view controller only has its view as a connection. Crash report excerpt below. Uploading the crash report isn't working for some reason, so I'll try to do so as a reply. The stack trace shows searchForClientURL... as the last part of our code that gets executed. I'm curious if I should look at things in our code that happen while the segue is being performed such as prepare(for:, sender:), the init of the destination controller, etc. or not because they're not showing up in the stack trace. Thanks for any help! 0 CoreFoundation 0x19e310e38 __exceptionPreprocess + 164 (NSException.m:202) 1 libobjc.A.dylib 0x19749f8d8 objc_exception_throw + 60 (objc-exception.mm:356) 2 UIKitCore 0x1a1306630 __66-[UIStoryboardPushSegueTemplate newDefaultPerformHandlerForSegue:]_block_invoke + 880 (UIStoryboardPushSegueTemplate.m:58) 3 UIKitCore 0x1a08f3c84 -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 172 (UIStoryboardSegueTemplate.m:134) 4 UIKitCore 0x1a08f3ba4 -[UIStoryboardSegueTemplate _perform:] + 68 (UIStoryboardSegueTemplate.m:121) 5 UIKitCore 0x1a0cc74c0 -[UIViewController performSegueWithIdentifier:sender:] + 300 (UIViewController.m:5017) 6 AWApp 0x10061ce38 closure #1 in ClientSelectorViewController.searchForClientURL(nameOrGUID:shouldTestSession:) + 3616 (ClientSelectorViewController.swift:231)
Posted
by
Post not yet marked as solved
4 Replies
470 Views
The line with the comment below has the error and says the error I am receiving. If you need to see anything else, do not hesitate to ask. I'd be happy to provide it. struct ContentView: View { @EnvironmentObject var myData: MyData @EnvironmentObject var userViewModel: UserViewModel var body: some View { VStack { NavigationSplitView { List { NavigationLink { MainApp() .navigationTitle ("Counter") } label: { HStack { Text("Counter") .font(.largeTitle) .foregroundColor(Color.red) Spacer() Image(systemName: "plus.forwardslash.minus") .font(.largeTitle) .foregroundColor(Color.red) .onTapGesture { myData.totalLeft = myData.total - myData.counter } } } NavigationLink { Settings() .navigationTitle("Settings") } label: { HStack { Text("Settings") .font(.largeTitle) .foregroundColor(Color.red) Spacer() Image(systemName: "gear") .font(.largeTitle) .foregroundColor(Color.red) } } NavigationLink { Metrics() .navigationTitle("Metrics") } label: { HStack { Text("Metrics") .font(.largeTitle) .foregroundColor(Color.red) Spacer() Image(systemName: "chart.bar") .font(.largeTitle) .foregroundColor(Color.red) } } NavigationLink { ProfileView() .navigationTitle ("Account") .environmentObject(userViewModel) //Thread 1: Fatal error: No ObservableObject of type UserViewModel found. A View.environmentObject(_:) for UserViewModel may be missing as an ancestor of this view. } label: { HStack { Text("Account") .font(.largeTitle) .foregroundColor(Color.red) Spacer() Image(systemName: "person") .font(.largeTitle) .foregroundColor(Color.red) } } } } detail: { Text("Select a Page") } } .environmentObject(userViewModel) } } import Foundation import FirebaseAuth import FirebaseFirestore import FirebaseFirestoreSwift class UserViewModel: ObservableObject { @Published var user: User? private let auth = Auth.auth() private let db = Firestore.firestore() var uuid: String? { auth.currentUser?.uid } var userIsAuthenticated: Bool { auth.currentUser != nil } var userIsAuthenticatedAndSynced: Bool { user != nil &amp;&amp; userIsAuthenticated } private func sync() { guard userIsAuthenticated else { return } let docRef = db.collection("users").document(self.uuid!) docRef.getDocument { (document, error) in guard let document = document, document.exists, error == nil else { print("Error retrieving document: \(error!)") return } do { let data = document.data() let jsonData = try JSONSerialization.data(withJSONObject: data as Any, options: .prettyPrinted) let user = try JSONDecoder().decode(User.self, from: jsonData) self.user = user } catch { print("Sync error: \(error)") } } } private func add (_ user: User) { guard userIsAuthenticated else { return } do { let userData = try JSONSerialization.jsonObject(with: try JSONEncoder().encode(user), options: []) as? [String: Any] let _ = try db.collection("users").document(self.uuid!).setData(userData ?? [:]) } catch { print("Error adding: \(error)") } } private func update() { guard userIsAuthenticatedAndSynced else { return } do { let userData = try JSONSerialization.jsonObject(with: try JSONEncoder().encode(user), options: []) as? [String: Any] let _ = try db.collection("users").document(self.uuid!).setData(userData ?? [:]) } catch { print("Error updating: \(error)") } } } struct MyApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate @StateObject var userViewModel = UserViewModel() var body: some Scene { WindowGroup { ContentView() .environmentObject(MyData()) .environmentObject(userViewModel) } } }
Posted
by
Post not yet marked as solved
0 Replies
499 Views
If I redirect to another site where there is a smart app banner and then I go back to my site. The innerHeight changes on my site. It doesn't always happen Steps to reproduce: Showing innerHeight on the screen of our site (screenshot 1) Use window.open(anotherSiteUrl, "_blank") to go to another site, where is the smart app banner (screenshot 2) Return to our site and look at innerHeight (innerHeight has changed) and white space below (screenshot 3) Screenshot 1: https://ibb.co/YDMPKpK Screenshot 2: https://ibb.co/WsJQhCr Screenshot 3: https://ibb.co/Y2GPZPH version: IOS 16, device: 13 pro max
Posted
by
Post not yet marked as solved
2 Replies
885 Views
When I cycled to test a download plugin, there was a crash, the log is as follows OS Version: iPhone OS 15.6.1 (Build 19G82) Architecture: arm64e Report Version: 35.1 Incident Identifier: 6F58ED96-DCC8-4352-BEE5-9956E04FD309 Data Source: Microstackshots Shared Cache: F851176E-88E2-3DC4-9FE5-B3B8D95B3502 slid base address 0x191d58000, slide 0x11d58000 Command: com.apple.StreamingUnzipService Path: /System/Library/PrivateFrameworks/StreamingZip.framework/XPCServices/com.apple.StreamingUnzipService.xpc/com.apple.StreamingUnzipService Identifier: com.apple.StreamingUnzipService Version: 1.0 (1) Architecture: arm64e Parent: launchd [1] PID: 55056 Event: disk writes Action taken: none Writes: 4294.98 MB of file backed memory dirtied over 18648 seconds (230.32 KB per second average), exceeding limit of 49.71 KB per second over 86400 seconds Writes limit: 4294.97 MB Limit duration: 86400s Writes caused: 4294.98 MB Writes duration: 18648s Duration: 18648.08s Duration Sampled: 18647.57s Steps: 1236 ( (10.49 MB/step)) Hardware model: iPhone11,8 Active cpus: 6 HW page size: 16384 VM page size: 16384 Advisory levels: Battery -&gt; 3, User -&gt; 3, ThermalPressure -&gt; 0, Combined -&gt; 3 Free disk space: 27.06 GB/59.55 GB, low space threshold 150 MB Heaviest stack for the target process: 410 ??? (libsystem_pthread.dylib + 3676) [0x203304e5c] 410 ??? (libsystem_pthread.dylib + 4284) [0x2033050bc] 410 ??? (libdispatch.dylib + 91392) [0x191dbf500] 410 ??? (libdispatch.dylib + 48308) [0x191db4cb4] 410 ??? (libdispatch.dylib + 45056) [0x191db4000] 410 ??? (libdispatch.dylib + 133196) [0x191dc984c] 410 ??? (libdispatch.dylib + 45056) [0x191db4000] 410 ??? (libdispatch.dylib + 129836) [0x191dc8b2c] 410 ??? (libdispatch.dylib + 15088) [0x191dacaf0] 410 ??? (libxpc.dylib + 64616) [0x20332ec68] 410 ??? (libxpc.dylib + 63544) [0x20332e838] 410 ??? (Foundation + 128660) [0x1938c3694] 410 ??? (Foundation + 193052) [0x1938d321c] 410 ??? (Foundation + 271964) [0x1938e665c] 410 ??? (com.apple.StreamingUnzipService + 114836) [0x104730094] 410 ??? (Foundation + 234368) [0x1938dd380] 410 ??? (com.apple.StreamingUnzipService + 115420) [0x1047302dc] 410 ??? (libsystem_kernel.dylib + 11956) [0x1c9be3eb4] Powerstats for: com.apple.StreamingUnzipService [55056] UUID: D12AADFD-5541-3E30-805A-D6594EC707F2 Path: /System/Library/PrivateFrameworks/StreamingZip.framework/XPCServices/com.apple.StreamingUnzipService.xpc/com.apple.StreamingUnzipService Identifier: com.apple.StreamingUnzipService Version: 1.0 (1) Architecture: arm64e Parent: launchd [1] UID: 501 Sudden Term: Tracked (allows idle exit) Footprint: 1696 KB Start time: 2023-05-16 12:09:07.472 +0800 End time: 2023-05-16 17:19:55.040 +0800 Num samples: 410 (33%) Primary state: 410 samples Non-Frontmost App, Non-Suppressed, Kernel mode, Effective Thread QoS User Initiated, Requested Thread QoS User Initiated, Override Thread QoS Unspecified User Activity: 9 samples Idle, 401 samples Active Power Source: 0 samples on Battery, 410 samples on AC 410 start_wqthread + 7 (libsystem_pthread.dylib + 3676) [0x203304e5c] 410 _pthread_wqthread + 287 (libsystem_pthread.dylib + 4284) [0x2033050bc] 410 _dispatch_workloop_worker_thread + 647 (libdispatch.dylib + 91392) [0x191dbf500] 410 _dispatch_lane_invoke + 443 (libdispatch.dylib + 48308) [0x191db4cb4] 410 _dispatch_lane_serial_drain + 375 (libdispatch.dylib + 45056) [0x191db4000] 410 _dispatch_mach_invoke + 455 (libdispatch.dylib + 133196) [0x191dc984c] 410 _dispatch_lane_serial_drain + 375 (libdispatch.dylib + 45056) [0x191db4000] 410 _dispatch_mach_msg_invoke + 463 (libdispatch.dylib + 129836) [0x191dc8b2c] 410 _dispatch_client_callout4 + 19 (libdispatch.dylib + 15088) [0x191dacaf0] 410 _xpc_connection_mach_event + 991 (libxpc.dylib + 64616) [0x20332ec68] 410 _xpc_connection_call_event_handler + 151 (libxpc.dylib + 63544) [0x20332e838] 410 message_handler + 227 (Foundation + 128660) [0x1938c3694] 410 -[NSXPCConnection _decodeAndInvokeMessageWithEvent:flags:] + 1819 (Foundation + 193052) [0x1938d321c] 410 __NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT_S2__ + 15 (Foundation + 271964) [0x1938e665c] 410 ??? (com.apple.StreamingUnzipService + 114836) [0x104730094] 410 -[NSData enumerateByteRangesUsingBlock:] + 135 (Foundation + 234368) [0x1938dd380] 410 ??? (com.apple.StreamingUnzipService + 115420) [0x1047302dc] 410 write + 8 (libsystem_kernel.dylib + 11956) [0x1c9be3eb4] Binary Images: 0x104714000 - ??? com.apple.StreamingUnzipService 1.0 (1) &lt;D12AADFD-5541-3E30-805A-D6594EC707F2&gt; /System/Library/PrivateFrameworks/StreamingZip.framework/XPCServices/com.apple.StreamingUnzipService.xpc/com.apple.StreamingUnzipService 0x191da9000 - 0x191deefff libdispatch.dylib &lt;E3EA4F63-5D11-342A-AF19-9F58DBC8E259&gt; /usr/lib/system/libdispatch.dylib 0x1938a4000 - 0x193baefff Foundation &lt;EE1ABAF2-3D71-37FB-9067-15AA79528619&gt; /System/Library/Frameworks/Foundation.framework/Foundation 0x1c9be1000 - 0x1c9c16fff libsystem_kernel.dylib &lt;1FB39303-587B-320E-AEB8-E51A54C8A4A9&gt; /usr/lib/system/libsystem_kernel.dylib 0x203304000 - 0x20330ffff libsystem_pthread.dylib &lt;ADC41700-002E-3A2B-B4A1-EB5FBF575770&gt; /usr/lib/system/libsystem_pthread.dylib 0x20331f000 - 0x20335bfff libxpc.dylib &lt;B1832133-79DC-3E42-B704-EF71F75A577E&gt; /usr/lib/system/libxpc.dylib Powerstats for: zeusframework UUID: EA2DC03A-4781-38F6-9CD1-FDCF2591FBF2 Path: /private/var/containers/Bundle/Application/6D4BC85D-EE77-4A09-B87E-AE871D1D2FBB/zeusframework.app/zeusframework Architecture: arm64 Start time: 2023-05-16 12:10:45.139 +0800 End time: 2023-05-16 17:01:21.715 +0800 Num samples: 726 (59%) Primary state: 505 samples Non-Frontmost App, Non-Suppressed, Kernel mode, Effective Thread QoS Default, Requested Thread QoS Default, Override Thread QoS Unspecified User Activity: 62 samples Idle, 664 samples Active Power Source: 0 samples on Battery, 726 samples on AC 726 thread_start + 7 (libsystem_pthread.dylib + 3688) [0x203304e68] 726 _pthread_start + 147 (libsystem_pthread.dylib + 6572) [0x203305
Posted
by
Post not yet marked as solved
2 Replies
435 Views
Greetings, We have observed an alarming number of crashes exceeding 1 million across various operating systems and devices. These crashes consistently point to a PAC failure in the specialized PreferenceNode.find<A>(key:) + 16 (PreferenceList.swift:146) function. The stack trace is exclusively a system-level stack, lacking any application-level stacks for us to go on. This makes it rather impossible for us to debug within our own application, since we do not have system-level context. Our analysis suggests that this issue may stem from either a compiler bug or an incorrectly implemented virtual-function in the AttributeGraph framework, resulting in a pointer-authentication failure in the SwiftUI framework. Lastly, if it helps, based on our own logs, we have determined that the problem primarily occurs when users return from being in the background for more than 60 minutes. However, despite numerous attempts, we have been unable to reproduce the issue ourselves. We kindly request your guidance on the most effective approach to address this matter confidently.
Posted
by
Post not yet marked as solved
0 Replies
927 Views
Hello all, I wanted to get MXMetricPayload to analyse some App metrics. And for some reason the method func didReceive(_ payloads: [MXMetricPayload]) from mxMetricManager is not being executed. For this I created a Class: import MetricKit public final class MetricKitManagerImpl: NSObject, MetricKitManager { public static let shared: MetricKitManager = MetricKitManagerImpl(mxMetricManager: MXMetricManager.shared) private let mxMetricManager: MXMetricManager private init( mxMetricManager: MXMetricManager ) { self.mxMetricManager = mxMetricManager super.init() mxMetricManager.add(self) } deinit { mxMetricManager.remove(self) } public func didReceive(_ payloads: [MXMetricPayload]) { payloads.forEach { if let scrollHitchTimeRatio = $0.animationMetrics?.scrollHitchTimeRatio.value { sendToSomeWhere(scrollHitchTimeRatio) } } } } Then on the AppDelegate on didFinishLaunchingWithOptions I do: private(set) var metricsManager: MetricKitManager! func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil ) -> Bool { self.metricsManager = MetricKitManagerImpl.shared ... } With this setUp I am able to receive the debug playload (triggered from Xcode Menu. Debug -> Simulate Metrik Kit Payload). However, after using the app for some days, I did not receive any real payload. Did anyone experience this? What am I doing wrong? Thanks a lot in advance! Miguel Franco
Posted
by
Post not yet marked as solved
0 Replies
991 Views
Hi All, Our crash reporting solution show app crashes for the user with crash reports which are not getting symbolicating to anything useful. it just says, App crashed on thread 0 (CoreAutoLayout -[NSISEngine negativeErrorVarForBrokenConstraintWithMarker:errorVar:] with it ending up on main.swift file. We have not able to replicate at our end, and it is happening only for a small fraction of our user (&lt; 1%). This issue is spread across multiple iOS versions and device models. We have verified all our UI actions are being done on main thread. Any pointers for solving this are welcome. Regards, Ishan
Posted
by