Debugging

RSS for tag

Discover and resolve issues with your app.

Posts under Debugging tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Crashes in requestSendPTPCommand(_:outData:completion:) of ImageCaptureCore framework
Hi there :) We're in our way to make an app to can communicate with DSLR camera by using ImageCaptureCore framework for PTP communication with the camera. In our app, we're sending some PTP commands to the camera by using requestSendPTPCommand(_:outData:completion:). This is our snipped-code to execute a PTP command. public extension ICCameraDevice { func sendCommand(command: Command) async { do { print("sendCommand ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++") print("sendCommand \(command.tag()) : sendCommand Started") let result = try await self.requestSendPTPCommand(command.encodeCommand().commandBuffer, outData: nil) let (data, response) = result print("sendCommand \(command.tag()) : sendCommand Finished") print("sendCommand data: \(data.bytes.count)") print("sendCommand response: \(response.bytes.count)") if !response.bytes.isEmpty { command.decodeResponse(responseData: response) } print("sendCommand \(command.tag()) : sendCommand Finished with response code \(command.responseCode)") print("sendCommand ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++") if command.responseCode != .ok { isRunning = false errorResponseCode = command.responseCode.rawValue print("response error with code = \(command.responseCode)") return } let copiedData = data.deepCopy() command.decodeData(data: copiedData) } catch { isRunning = false print("Error Send Command with error: \(error.localizedDescription)") } } } The function sendCommand(command: Command) async is called in a while-loop in async-await way. So that it needs to wait a sent command to finish before executing another command. The looping keeps running since the device connected to the camera. The result is, the process is running by no problem at all for several minutes, It can get camera's setting, device info, even its images. But then the problems occurred. The amount of time is random, some time it takes only 15 minutes, some time it takes 1 hour. There are 2 problems recorded in our case: 1. The requestSendPTPCommand(_:outData:completion:) result returning empty data without throwing any error, because the error never be caught in catch block. This is my printed result: sendCommand +++++++++++++++++++++++++++++++++++++ sendCommand GetObjectHandlesCommand : sendCommand Started sendCommand GetObjectHandlesCommand : sendCommand Finished sendCommand data: 0 sendCommand response: 0 sendCommand GetObjectHandlesCommand : sendCommand Finished with response code undefined sendCommand +++++++++++++++++++++++++++++++++++++ 2. It crashes with the last message in my logger: sendCommand +++++++++++++++++++++++++++++++++++++ sendCommand GetObjectHandlesCommand : sendCommand Started 2023-10-27 10:44:37.186768+0700 PTPHelper_Example[76486:11538353] [PTPHelper_Example] remoteCamera ! Canon EOS 200D - Error Domain=NSCocoaErrorDomain Code=4097 “connection to service with pid 76493 created from an endpoint” UserInfo={NSDebugDescription=connection to service with pid 76493 created from an endpoint} 2023-10-27 10:44:37.187146+0700 PTPHelper_Example[76486:11538353] [PTPHelper_Example] failureBlock ! Canon EOS 200D - Failure block was called due to a connection failure. For crashed issue, I've tried to attach in this post. But it always failed with messaged An error occured while uploading this log. Please try again later.. So that, I uploaded it in my google drive with url: https://drive.google.com/file/d/1IvJohGwp1zSkncTWHc3430weGntciB3K/view?usp=sharing Reproduced on iOS 16.3.1. I've checked the stack traces of the other threads but nothing suspicious got my attention. But it might relate to this issue https://developer.apple.com/forums/thread/104576. But I can't ensure. Any good idea of how to address these crashes shown above? Thank you!
3
0
517
Oct ’23
SwifftUI iPadOS landscape view bug
Hi there, I am currently developing an app for iPhone and iPad. I made a sidebar with various items which are linked to other pages via NavigationLink. The problem is, that as soon as I scroll down, the app crashes. This is only happening in landscape mode on the iPad. What am I doing wrong? Thank you for your help! Here is my code: var body: some View { NavigationView { List { Group { NavigationLink(destination: Acetylsalicylsaeure()){ Image("AcetylsalicylsaeureMediLabel") .resizable() .frame(width:60, height: 30) Text("Acetylsalicylsäure") } NavigationLink(destination: Amiodaron()){ Image("AmiodaronMediLabel") .resizable() .frame(width:60, height: 30) Text("Amiodaron") } NavigationLink(destination: Atropin()){ Image("AtropinMediLabel") .resizable() .frame(width:60, height: 30) Text("Atropin") } NavigationLink(destination: Butylscopolamin()){ Image("ButylscopolaminMediLabel") .resizable() .frame(width:60, height: 30) Text("Butylscopolamin") } NavigationLink(destination: Dimenhydrinat()){ Image("DimenhydrinatMediLabel") .resizable() .frame(width:60, height: 30) Text("Dimenhydrinat") } NavigationLink(destination: Dimentinden()){ Image("DimentindenMediLabel") .resizable() .frame(width:60, height: 30) Text("Dimentinden") } NavigationLink(destination: Epinephrin()){ Image("EpinephrinMediLabel") .resizable() .frame(width:60, height: 30) Text("Epinephrin") } NavigationLink(destination: Esketamin()){ Image("EsketaminMediLabel") .resizable() .frame(width:60, height: 30) Text("Esketamin") } } // More NavigationLinks... Group { NavigationLink(destination: Midazolam()){ Image("MidazolamMediLabel") .resizable() .frame(width:60, height: 30) Text("Midazolam") } NavigationLink(destination: Naloxon()){ Image("NaloxonMediLabel") .resizable() .frame(width:60, height: 30) Text("Naloxon") } NavigationLink(destination: Paracetamol()){ Image("ParacetamolMediLabel") .resizable() .frame(width:60, height: 30) Text("Paracetamol") } NavigationLink(destination: Prednisolon()){ Image("PrednisolonMediLabel") .resizable() .frame(width:60, height: 30) Text("Prednisolon") } NavigationLink(destination: Salbutamol()){ Image("SalbutamolMediLabel") .resizable() .frame(width:60, height: 30) Text("Salbutamol") } NavigationLink(destination: Sauerstoff()){ Image("SauerstoffMediLabel") .resizable() .frame(width:60, height: 30) Text("Sauerstoff") } NavigationLink(destination: Urapidil()){ Image("UrapidilMediLabel") .resizable() .frame(width:60, height: 30) Text("Urapidil") } NavigationLink(destination: Vollelektrolytloesung()){ Image("VollelektrolytloesungMediLabel") .resizable() .frame(width:60, height: 30) Text("Vollelektrolytlösung") } } } .listStyle(SidebarListStyle()) .navigationTitle("Medikamente") BackgroundMedikamente() } } }
0
0
361
Oct ’23
Different symbols for different iOS-Versions.
Hi there, I am currently developing an app with a tab view. Unfortunately some the symbols I use only work for iOS 17. I would like to change a symbol but only for iOS 16. Is this possible? Thank you for your help! Laurin Here is my code: struct ContentView: View { var body: some View { TabView { Group { Medikamente() .tabItem { Image(systemName: "syringe") Text("Medikamente") } BPR() .tabItem { Image(systemName: "point.bottomleft.forward.to.arrowtriangle.uturn.scurvepath") Text("BPR") } InvasiveMassnahmen() .tabItem { Image(systemName: "heart.text.square") Text("Maßnahmen") } } } } } #Preview { ContentView() }
1
0
338
Oct ’23
Get Callstacks and demangle C++
Dear Sirs, while it's quite clear that I'll try to write applications that do not crash unfortunately this can happen. In this case I'd like to write a detailed crash report including callstacks for all threads to my logfiles even from Release builds on the customers machine. So I started to do some tests with backtrace and backtrace_symbols and this already seems to solve a lot. Nevertheless I don't really get as close to the error report shown by the MacOS error report as I'd have hoped. I have a problem with demangling the C++ objects and I cannot get the line numbers. So something which looks like this in the Apple MacOS error report: 5 MyCrashTestApp 0x10445f150 CZMQConnection::CFnCalledWorkerThread::Thread() + 132 (ZMQConnection.cpp:1128) looks like this in my callstack: 5 MyCrashTestApp 0x000000010445f150 _ZN14CZMQConnection21CFnCalledWorkerThread6ThreadEv + 132 I tried different ways of demangling with calls to abi::__cxa_demangle() and dladdr() beforehand but so far the output didn't change and the filename and line numbers are completely missing. How can I achieve an output like the one of the Apple MacOS error report including the filenames and line numbers and will this also work on customers machines? How do i have to configure my C++ XCode project for this? Thanks and best regards, Johannes
2
0
667
Oct ’23
How to analyse app crashed in main thread with uncaught exception rethrown by CFRunLoop with no proper backtrace
My app crashes in the main thread, the crash happens randomly no definite pattern and happens only on iPad OS, the crash never occurred on iPhone. Can someone helpmeet how to proceed with analysing this crash log. It looks like a uncaught exception was thrown but it was trapped by CFRunLoop exception handler and actual backtrace is lost. Can someone help me to analyse this log or how to get actual backtrace ? NcpClient 25.10.23, 13-27.crash
1
0
629
Nov ’23
iOS 17.2 Beta Crash: Fatal Exception: NSInternalInconsistencyException Accessing invalid yOrigin on <_UIBarInsertLayoutData: 0x283b30f60> 'SearchBar'
Hi, I have been experiencing a growing number of crashes for our iOS 17.2 Beta users. Despite attempts, I am unable to reproduce the issue on any devices. Device tried: iPhone 13 Pro, iPhone 12, iPhone 13 mini. PFB Stack trace Fatal Exception: NSInternalInconsistencyException Accessing invalid yOrigin on <_UIBarInsertLayoutData: 0x283b30f60> 'SearchBar' minimumHeight=0.000000 preferredHeight=0.000000 assignedHeight=0.000000 collapsible priority=1700 order=50 Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0xec860 __exceptionPreprocess 1 libobjc.A.dylib 0x2bbe0 objc_exception_throw 2 Foundation 0x6b0dd8 _userInfoForFileAndLine 3 UIKitCore 0x57f4e4 -[_UIBarInsertLayoutData verticalOrigin] 4 UIKitCore 0x587300 -[_UINavigationBarLayout _layoutFrameFor:withOrder:] 5 UIKitCore 0x5873e4 -[_UINavigationBarLayout searchBarLayoutFrame] 6 UIKitCore 0x58d948 -[_UINavigationBarTransitionContextPush _finishWithFinalLayout:invalidLayout:] 7 UIKitCore 0x58dad0 -[_UINavigationBarTransitionContextPush complete] 8 UIKitCore 0x598968 -[_UINavigationBarVisualProviderModernIOS _endTransitionCompleted:] 9 UIKitCore 0x599d64 __96-[_UINavigationBarVisualProviderModernIOS _performAnimationWithTransitionCompletion:transition:]_block_invoke_7 10 UIKitCore 0x84cf8 __UIVIEW_IS_EXECUTING_ANIMATION_COMPLETION_BLOCK__ 11 UIKitCore 0x84490 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] 12 UIKitCore 0x83b08 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] 13 UIKitCore 0x65c30 -[UIViewAnimationState animationDidStop:finished:] 14 QuartzCore 0x7208c run_animation_callbacks(void*) 15 libdispatch.dylib 0x4300 _dispatch_client_callout 16 libdispatch.dylib 0x12998 _dispatch_main_queue_drain 17 libdispatch.dylib 0x125b0 _dispatch_main_queue_callback_4CF 18 CoreFoundation 0x371ec __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ 19 CoreFoundation 0x33ef8 __CFRunLoopRun 20 CoreFoundation 0x33648 CFRunLoopRunSpecific 21 GraphicsServices 0x34f8 GSEventRunModal 22 UIKitCore 0x22cbcc -[UIApplication _run] 23 UIKitCore 0x22c208 UIApplicationMain 24 UIKitCore 0x455710 __swift_destroy_boxed_opaque_existential_1Tm 25 Stocard 0x7e2c main (SetupAppIconBadge.swift) 26 ??? 0x1c4129dcc (Missing)
1
0
1k
Nov ’23
UITextView Apple Pencil crash
I used Apple Pencil to input text on UITextView, but the program crashed when I long pressed and tried to use the insert function. warning: Module "/Users/baochengzhu/Library/Developer/Xcode/iOS DeviceSupport/iPad14,1 17.0.3 (21A360)/Symbols/usr/lib/libobjc.A.dylib" uses triple "arm64e-apple-ios17.0.0", which is not compatible with the target triple "arm64-apple-ios11.0.0". Enabling per-module Swift scratch context who can help me ?
0
0
293
Nov ’23
Combine views in SwiftUI
Hi there, I am still quite new to Swift and want to combine a few views into one single view. But the problem is, that if I do it like in the following code, there are windows for each view. Is there a chance to code it that it is one coherent view where I can scroll through? Thank you for your help! Laurin @AppStorage("MediAnsicht") var MedisEinfacheAnsicht = false var body: some View { if MedisEinfacheAnsicht == true { AcetylsalicylsaeureAllgInfos() AcetylsalicylsaeureKontraind() AcetylsalicylsaeureUAWs() } else { AcetylsalicylsaeureMenu() } } }
2
0
392
Nov ’23
It came out after I updated to xcode 15
when I run it on iOS 16, the app pauses and doesn't run , but everything is fine on iOS 17 xcode: 15.0.1 dyld': 0x1e0eaffc4 0x1e0eaffc8 -&gt; 0x1edeaffcc 0x1e0eaffdo 0x1e0eaffd4 0x1e0eaffd8 0x1e0eaffdc 0x10eaffel 0x1edeaffe4 0x1e0eaffe8 0x1e0eaffec &lt;+0&gt;: &lt;+4&gt;: &lt;+8&gt;: &lt;+12&gt;: &lt;+16&gt;: &lt;+20&gt;: &lt;+24&gt;: &lt;+28&gt;: &lt;+32&gt;: &lt;+36&gt;: &lt;+40&gt;: mov SVC b.10 pacibsp stp mov bl mov 1dp retab ret ×16, #0x209 #0x80 0x1edeaffec ×29, ×30, [sp, #-0x10]! ×29, sp 0x1e0e4b750 sp, ×29 ×29, ×30, [sp], #0x10 : &lt;+40&gt; i cerror_nocancel Thread 1: signal SIGABRT
1
0
234
Nov ’23
Setting UIViewController preferredContentSize is broken in iOS 17
In iOS 17, I am having an issue where UIPopoverPresentationControllers are not retaining the preferred size of the UIViewController they contain. The following method uses a UIPopoverPresentationController popoverVC to display a UIViewController contentVC from a UIView view anchor location frame. + (void) showDialogiPad:(UIViewController *)contentVC fromPresentingVC:(UIViewController *)presentingVC inView:(UIView *)view atFrame:(CGRect)frame withDirection:(UIPopoverArrowDirection)direction { // Set content view controller size contentVC.preferredContentSize = contentVC.view.frame.size; // Choose the presentation style in which the content is // displayed in a popover view contentVC.modalPresentationStyle = UIModalPresentationPopover; // Get a popover presentation controller UIPopoverPresentationController *popoverVC = contentVC.popoverPresentationController; // Set the popover size and anchor location contentVC.popoverPresentationController.sourceRect = frame; contentVC.popoverPresentationController.sourceView = view; // Set the arrow direction for the popover popoverVC.permittedArrowDirections = direction; // Present the popover presentation controller [presentingVC presentViewController:contentVC animated:YES completion:nil]; } Prior to iOS 17, the code displayed the popover as expected as shown here: The issue now however is since the update to iOS 17, the popover is now squashed and displayed as: A few observations: The popover dialog actually displays properly the first time you open it. Every subsequent time you open it, it is squashed. When I comment out the line that sets the preferredContentSize, the popover opens at the max size every time - so it shows all the content but it is not set to the size I want it to be. If I leave preferredContentSize as is but change modalPresentationStyle to UIModalPresentationFormSheet, the size of the popover is correct but the popover always presents in the middle of the screen.
1
0
581
Nov ’23
PHPickerViewController 选择图片后直接奔溃 iPhone是 iOS 14+ 系统测试
PHPickerViewController 选择图片后直接奔溃 iPhone是 iOS 14+ 系统测试的 ![](“https://developer.apple.com/forums/content/attachment/34b6441d-f7a3-4125-95d6-7fb5972c44fa”,“title=微信IMG84.jpg;宽度=1069;高度=1002") ![](“https://developer.apple.com/forums/content/attachment/31e73caf-97fa-46bb-bd5b-1f385c5ef6b8”,“title=微信IMG85.jpg;宽度=809;高度=979") ![](“https://developer.apple.com/forums/content/attachment/da5ef40a-944e-4dea-a30a-1ca19465cf47”,“title=微信IMG86.jpg;宽度=1579;高度=997") 崩溃信息是: 线程 2:“无法从&lt;_NSProgressProxy 0x281b0ed00&gt;中删除键路径 \”fractionCompleted\“ 的观察者 &lt;PUPhotosFileProviderItemProvider 0x28003db80&gt;,因为它未注册为观察者。 B K(英语:B K)
2
0
410
Nov ’23
AR viewer is Bugging out in iPhone 12 and Above (For models with Glass in 3D model)
While experimenting with AR view for different Product We came across an issue with Apples AR viewer where for glass (PBR Opacity) it is causing black patch to appear behind (Maybe Shadow). https://sketchfab.com/3d-models/welcome-5ba96662ba8d4774951f33fead4bf9db https://sketchfab.com/3d-models/candel-91b2059634e0478eb93777b0b2a726e9 We Tried to find work around but after doing multiple test but with all our experiments we came to the conclusion that Apple AR viewer is not able recognize the glass material and adjust the ground shadow as required.
0
0
674
Nov ’23
Amplify/GraphQL - Issue getting full data with one-to-one relationship
Just to give some background, we have two tables with a one to one relationship. So, Table A has a one-to-one relationship with Table B. With amplify, I see that Table A has a foreign key for Table B. When we do a query to fetch a list of items using a filter, we call for a list of items from Table A. With graphQL, since we have the @hasOne key, the data from table B will be nested inside each row from table A data. When I test the raw graphQL query itself on amplify's console, it's fine, but on xcode, the nested data from Table B is showing up as null. Has anyone have an idea on what is causing this? If you need clarification, do not hesitate to let me know! Some things I have tried are here: https://docs.amplify.aws/cli/migration/lazy-load-custom-selection-set/ Now, I have set "generateModelsForLazyLoadAndCustomSelectionSet" to true, but it caused a compilation error. One of the message is that "LazyReference" has not been found. So, I've been having trouble implementing one of the suggestions. The main problem is that, how can I have data from table B show up in my results when I query for a list of items from table A? This is only happening with 'hasOne' relationship.
0
0
257
Nov ’23
Remove list headers in .searchable
Hi there, I am still quite new to SwiftUI and made a .searchable list as you can see in my code below. When I search, all list headers are displayed, even if there aren't any results in that list. How can I fix that? Thank you for your help! Laurin //Herangehensweise "basismaßnahmen", "cabcde herangehensweise", "cabcde instabilitäten", "beurteilung der bewusstseinslage", "sampler", "opqrst", "atemwegsmanagement", "patientenanmeldung", //Kreislaufstillstand "erwachsene bls reanimation", "erwachsene als mit manueller defibrillation reanimation", "erwachsene als mit aed reanimation", "kinder pls reanimation", "neugeborene pls baby reanimation", "postreanimationstherapie rosc", //Leitsymptome "dyspnoe atemnot luft", "kritische blutung tourniquet", "kurzzeitige bewusstlosigkeit synkope tloc", "nichttraumatischer brustschmerz thorax acs akutes aortensyndrom lungenembolie lae spontanpneumothorax spannungspneumothorax", "schock blut volumenmangel blutdruck hypoton blutverlust", "starke schmerzen nrs analgesie analgosedierung midazolam dormicum esketamin ketanest", "zentrales neurologisches defizit bewusstlosigkeit", //Krankheitsbilder //More entries... ] struct BPR: View { var bprs: [String] { let lcBprs = listOfBPRs.map { $0.lowercased() } return searchText == "" ? lcBprs : lcBprs.filter { $0.contains(searchText.lowercased()) } } private var listOfBPRs = bprlist @State var searchText = "" var body: some View { NavigationView { List { Group { Section (header: Text("Herangehensweise")){ ForEach(bprs, id: \.self) { bpr in if bpr.contains("basismaßnahmen") { NavigationLink(destination: Basismassnahmen()) { Label { Text("Basismaßnahmen") } icon: { Image(systemName: "list.bullet.clipboard") } } } else if bpr.contains("cabcde herangehensweise"){ NavigationLink(destination: cabcdeHerangehensweise()) { Label { Text("cABCDE-Herangehensweise") } icon: { Image(systemName: "abc") } } } else if bpr.contains("cabcde instabilitäten"){ NavigationLink(destination: cabcdeInstabilitaeten()) { Label { Text("cABCDE-Instabilitäten") } icon: { Image(systemName: "textformat.abc.dottedunderline") } } } //More else if statements and groups... } } } } } .searchable(text: $searchText) .disableAutocorrection(true) .background(Color.clear) .listStyle(SidebarListStyle()) .navigationTitle("Behandlungspfade") .navigationBarTitleDisplayMode(.automatic) .toolbar { NavigationLink(destination: About()){ Image(systemName: "info.circle") } NavigationLink(destination: Settings()){ Image(systemName: "gear") } } BackgroundMedikamente() } } }
2
0
640
Nov ’23
Help symbolicating report and understanding what I need to fix. App rejected due to crash on launch.
I ran the app using 'npx expo start' in VScode with no problem. I opened the .xcworkspace in XCode and the app launches with no problem. I submitted my app to the app store. It was rejected due to crash on launch: "We were unable to review your app as it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue. Review device details: Device type: iPad OS version: iOS 17.1" Apple provided crashlog.txt files and suggests the following: " To address the crash in your app, follow these steps: Fully symbolicate the crash report. See Adding Identifiable Symbol Names to a Crash Report for an explanation of the symbolication process. Match the crash report to a common pattern. Based on the pattern, take specific actions to further investigate the crash. See Identifying the Cause of Common Crashes. Test your app on a device to ensure that it now runs as expected. Once you’ve addressed the crash, create and submit a new build to the App Store for review. " I previously ran a few terminal commands to symbolicate the crash report. I got an output file but I don't know how to read it or figure out what it is telling me to fix. I understand this part indicates a language exception but that's as far as I understood: "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"}, "termination" : {"flags":0,"code":6,"namespace":"SIGNAL","indicator":"Abort trap: 6","byProc":"xp1","byPid":3803}, "asi" : {"libsystem_c.dylib":["abort() called"]}, "lastExceptionBacktrace" : [{"imageOffset":968816,"symbol":"__exceptionPreprocess","symbolLocation":164,"imageIndex":3},{"imageOffset":179200,"symbol":"objc_exception_throw","symbolLocation":60,"imageIndex":9}, Can I please get some guidance on how to identify why the app crashes on launch according to apple?
2
0
380
Nov ’23