Hello, I am looking for some help today about a crash that randomly appeared for no explicit reason. A bit of context, I have 2 apps/targets within the project and the only thing that changes between the two is pretty much the API and the colors/logos.
I have published an update for both apps, the related code hasn't changed since the previous versions (it has been in production for 6 months already), and it's only crashing in the same app, not in the other one somehow. It happens on multiple iOS versions and devices as well. Of course, I am unable to reproduce the crash.
I am using Firebase Crashlytics, which gives me this error message :
Fatal Exception: NSInternalInconsistencyException - You must provide a value (key=contents)
And in the Xcode Organizer, the highlighted stack trace line responsible for the crash is the following :
3 UIKitCore 0x1c2ad5970 -[_UIViewDeferredAnimation addAnimationFrameForValue:] + 216 (UIView.m:2792)
About the code, I have a custom searchBar and a cancelButton embedded in a UIStackView, I am animating the cancelButton visibility using .isHidden to replicate the experience you get when using a UISearchController in the navigationBar.
About the crash, it seems to be triggered when animating keyframes using UIView.animateKeyframes, with multiple UIView.addKeyframe within the animation block, at least that's why I understand from the stack trace.
The code is really simple, when the searchBarTextField becomes the first responder and begins editing, I animate the cancelButton in. The cancelButtonAnimationOptions are the followings : .curveEaseInOut, .beginFromCurrentState and .allowUserInteraction.
func textFieldDidBeginEditing(_ textField: UITextField) {
showSearchBarCancelButton()
}
func showSearchBarCancelButton() {
let duration = Layout.animationDuration
let options = Layout.cancelButtonAnimationOptions
UIView.animateKeyframes(withDuration: duration, delay: 0, options: options, animations: {
UIView.addKeyframe(withRelativeStartTime: 0.0, relativeDuration: 1, animations: {
self.cancelButton.isHidden = false
self.cancelButton.superview?.layoutIfNeeded()
})
UIView.addKeyframe(withRelativeStartTime: 0.7, relativeDuration: 0.3, animations: {
self.cancelButton.alpha = 1
})
})
}
Here is a preview of the stack trace :
(Check Log.crash in the attachments for the full version) :
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x1c057de88 __exceptionPreprocess + 164 (NSException.m:202)
1 libobjc.A.dylib 0x1b98ab8d8 objc_exception_throw + 60 (objc-exception.mm:356)
2 Foundation 0x1bae99b4c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 188 (NSException.m:242)
3 UIKitCore 0x1c2ad5970 -[_UIViewDeferredAnimation addAnimationFrameForValue:] + 216 (UIView.m:2792)
4 UIKitCore 0x1c2ad5208 -[_UIViewDeferredKeyframeAnimation addAnimationFrameForValue:] + 72 (UIView.m:2901)
5 UIKitCore 0x1c2ad5148 __93-[UIViewKeyframeAnimationState addKeyframeWithRelativeStartTime:relativeDuration:animations:]_block_invoke + 368 (UIView.m:2651)
6 CoreFoundation 0x1c0587588 __NSDICTIONARY_IS_CALLING_OUT_TO_A_BLOCK__ + 24 (NSDictionaryHelpers.m:10)
7 CoreFoundation 0x1c0611bc0 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 212 (NSDictionaryM_Common.h:311)
8 UIKitCore 0x1c2b636c8 -[UIViewKeyframeAnimationState addKeyframeWithRelativeStartTime:relativeDuration:animations:] + 156 (UIView.m:2638)
9 UIKitCore 0x1c2b635dc +[UIView(UIViewKeyframeAnimations) addKeyframeWithRelativeStartTime:relativeDuration:animations:] + 132 (UIView.m:15468)
10 MyApp 0x102b657f8 closure #1 in FavoritesViewController.showSearchBarCancelButton() + 196 (FavoritesViewController+Search.swift:45)
11 MyApp 0x102c04198 thunk for @escaping @callee_guaranteed () -> () + 28 (<compiler-generated>:0)
12 UIKitCore 0x1c28011e4 +[UIView _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 512 (UIView.m:15213)
13 UIKitCore 0x1c292e140 +[UIView(UIViewKeyframeAnimations) animateKeyframesWithDuration:delay:options:animations:completion:] + 156 (UIView.m:15458)
14 MyApp 0x102b655a4 FavoritesViewController.showSearchBarCancelButton() + 44 (FavoritesViewController+Search.swift:44)
15 MyApp 0x102b655a4 FavoritesViewController.textFieldDidBeginEditing(_:) + 44 (FavoritesViewController+Search.swift:12)
16 MyApp 0x102b655a4 @objc FavoritesViewController.textFieldDidBeginEditing(_:) + 224 (<compiler-generated>:11)
17 UIKitCore 0x1c2c949c8 -[UITextField _notifyDidBeginEditing] + 104 (UITextField.m:1910)
18 UIKitCore 0x1c2952554 -[UITextField _becomeFirstResponder] + 196 (UITextField.m:1842)
19 UIKitCore 0x1c294ffa4 -[UIResponder becomeFirstResponder] + 516 (UIResponder.m:392)
20 UIKitCore 0x1c294fd90 -[UIView(Hierarchy) becomeFirstResponder] + 120 (UIView.m:12379)
21 UIKitCore 0x1c2803bc4 -[UITextField becomeFirstResponder] + 152 (UITextField.m:1496)
22 MyApp 0x102ab6840 CustomSearchBar.onSearchBarTap(_:) + 36 (CustomSearchBar.swift:36)
23 MyApp 0x102ab6840 @objc CustomSearchBar.onSearchBarTap(_:) + 88 (<compiler-generated>:35)
Thanks for your help!
Debugging
RSS for tagDiscover and resolve issues with your app.
Posts under Debugging tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I've started seeing several users getting an app crash that I've been unable to find the root cause for so far. I've tried running the app in release build with address sanitizer and zombie objects checks enabled but have been unable to reproduce it. It only occurs for iOS 17 users. Any ideas on how I can troubleshoot this?
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
Crashed: com.apple.main-thread
0 libsystem_platform.dylib 0xed4 _platform_memmove + 52
1 QuartzCore 0x137120 CA::Render::InterpolatedFunction::encode(CA::Render::Encoder*) const + 248
2 QuartzCore 0x136f40 CA::Render::GradientLayer::encode(CA::Render::Encoder*) const + 44
3 QuartzCore 0x2e384 CA::Render::Layer::encode(CA::Render::Encoder*) const + 284
4 QuartzCore 0x2e224 CA::Render::encode_set_object(CA::Render::Encoder*, unsigned long, unsigned int, CA::Render::Object*, unsigned int) + 196
5 QuartzCore 0x2b654 invocation function for block in CA::Context::commit_transaction(CA::Transaction*, double, double*) + 244
6 QuartzCore 0x2b4fc CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 368
7 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
8 QuartzCore 0x2b4bc CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 304
9 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
10 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
11 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
12 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
13 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
14 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
15 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
16 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
17 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
18 QuartzCore 0x2b488 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block_pointer) + 252
19 QuartzCore 0x6fc60 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 11192
20 QuartzCore 0x66574 CA::Transaction::commit() + 648
21 UIKitCore 0x31b5ec __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 36
22 CoreFoundation 0x373a8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
23 CoreFoundation 0x35b9c __CFRunLoopDoBlocks + 356
24 CoreFoundation 0x33a9c __CFRunLoopRun + 848
25 CoreFoundation 0x33668 CFRunLoopRunSpecific + 608
26 GraphicsServices 0x35ec GSEventRunModal + 164
27 UIKitCore 0x22c2b4 -[UIApplication _run] + 888
28 UIKitCore 0x22b8f0 UIApplicationMain + 340
29 Coach 0x799d8 main + 14 (main.m:14)
30 ??? 0x1abefadcc (Missing)
We are facing an issue in IOS version 16.3.1
where the animation based loader is not getting visible, but .svg based loader is working fine and
the same animation based loader is working fine in android and windows, and all the remaining versions of IOS as well
The html code :
<div class="showbox overlayhideclass" id="overlayhideapple" style="display:none;opacity:2.9;">
<div class="loader">
<svg class="circular darkLoader" style="display:none;" viewBox="25 25 50 50">
<!-- Background ring -->
<circle class="background-ring" cx="50" cy="50" r="22"></circle>
<!-- Loading circle -->
<circle class="path" cx="50" cy="50" r="22" fill="none" stroke-width="6" stroke-miterlimit="10"></circle>
</svg>
<svg class="circular lightLoader" style="" viewBox="25 25 50 50">
<!-- Background ring -->
<circle class="background-ring" cx="50" cy="50" r="22"></circle>
<!-- Loading circle -->
<circle class="path" cx="50" cy="50" r="22" fill="none" stroke-width="6" stroke-miterlimit="10"></circle>
</svg>
</div>
</div>
classes:
.loader {
position: relative;
margin: 0 auto;
width: 100px;
&:before {
content: "";
display: block;
padding-top: 100%;
}
}
.circular {
animation: rotate 1s linear infinite;
height: 100%;
transform-origin: center center;
width: 74.84%;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
border-radius: 50%;
}
.background-ring {
fill: none;
stroke: rgb(227, 226, 231);
stroke-width: 6;
}
.path {
stroke-dasharray: 1, 200;
stroke-dashoffset: 0;
animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite;
stroke-linecap: round;
}
@keyframes rotate {
100% {
transform: rotate(360deg);
-webkit-transform: rotate(360deg);
}
}
@keyframes dash {
0% {
stroke-dasharray: 100, 200;
stroke-dashoffset: -100px;
}
30% {
stroke-dasharray: 100, 200;
stroke-dashoffset: -100px;
}
100% {
stroke-dasharray: 100, 200;
stroke-dashoffset: -100px;
}
}
@keyframes color {
100%,
0% {
stroke:var(--loader-icon);
}
40% {
stroke:var(--loader-icon);
}
66% {
stroke:var(--loader-icon);
}
80%,
90% {
stroke:var(--loader-icon);
}
}
body {
background-color: var(--white);
}
.showbox {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
}
.overlayhideclass {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
text-align: center;
opacity: 2.9;
background-color: Var(--pg-bg-primary);
z-index: 9999;
display: flex;
justify-content: center;
justify-items: center;
justify-self: center;
overflow:-y:hidden;
}
.darkLoader {
z-index: 100;
display: flex;
justify-content: center;
align-items: center;
}
.lightLoader{
z-index: 100;
display: flex;
justify-content: center;
align-items: center;
}
block of code used in aditionl to the errors shown below i cant not share an image along a message to whatsapp, it will only take the message, for it to take the picture the messahe must be removed.
ShareLink("Share Status as image",
item: renderedImage,
subject:Text("\(itemDue.customerName) your order is ready"),
// message: Text(mesaage),
// ,
preview: SharePreview("Order status", image: renderedImage)
)
.foregroundStyle(.white)
.padding(5)
.frame(maxWidth: .infinity)
.background(
RoundedRectangle(cornerRadius: 15)
.stroke(Color.white, lineWidth: 2)
)
when sharelink is being use i get the errors must current ios version and xcode:
2024-02-01 17:27:48.792287-0500 Tailored[4866:1376699] [ProcessSuspension] 0x11d0218c0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess NearSuspended Assertion' for process with PID=4876, error: Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}
ADitional ERROR
2024-02-01 17:17:31.597616-0500 Tailored[4849:1370660] (501) personaAttributesForPersonaType for type:0 failed with error Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.mobile.usermanagerd.xpc was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.mobile.usermanagerd.xpc was invalidated: failed at lookup with error 159 - Sandbox restriction.}
2024-02-01 17:17:31.602413-0500 Tailored[4849:1371023] [general] Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false}
2024-02-01 17:17:31.602451-0500 Tailored[4849:1371023] [process] elapsedCPUTimeForFrontBoard couldn't generate a task port
2024-02-01 17:17:31.602690-0500 Tailored[4849:1371023] [general] Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false}
2024-02-01 17:17:31.602726-0500 Tailored[4849:1371023] [process] elapsedCPUTimeForFrontBoard couldn't generate a task port
2024-02-01 17:17:31.605430-0500 Tailored[4849:1371377] [general] Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false}
2024-02-01 17:17:31.605490-0500 Tailored[4849:1371377] [process] elapsedCPUTimeForFrontBoard couldn't generate a task port
2024-02-01 17:17:34.999553-0500 Tailored[4849:1371371] [ShareSheet] connection invalidated
I am a beginner to swift language and with the help of apple book, I was typing this code on switching colours using buttons.
then in this line: if redswitch.isOn {
it is showing this fatal error. What to do I have no idea. Please help me out.
Here's the code:
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var colourView: UIView!
@IBOutlet weak var redswitch: UISwitch!
@IBOutlet weak var greenswitch: UISwitch!
@IBOutlet weak var blueswitch: UISwitch!
override func viewDidLoad() {
super.viewDidLoad()
updateColor()
// Do any additional setup after loading the view.
}
@IBAction func switchChanged(_sender: UISwitch){
updateColor()
}
func updateColor() {
var red: CGFloat = 0
var green: CGFloat = 0
var blue: CGFloat = 0
if redswitch.isOn {
red = 1
}
if greenswitch.isOn {
green = 1
}
if blueswitch.isOn {
blue = 1
}
let color = UIColor(red: red, green: green,
blue: blue, alpha: 1)
colourView.backgroundColor = color
}
}
I often get crash logs where nothing in the stack trace is my code, other than an entry point in main. I don't know how to use these to figure out where the problem is. For example this one,
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x1c21cf180 __exceptionPreprocess + 228 (NSException.m:172)
1 libobjc.A.dylib 0x1c13a79f8 objc_exception_throw + 56 (objc-exception.mm:557)
2 UIKitCore 0x1ee572b1c -[UINavigationController pushViewController:transition:forceImmediate:] + 2312 (UINavigationController.m:7317)
3 UIKitCore 0x1ee5720b0 -[UINavigationController pushViewController:animated:] + 664 (UINavigationController.m:7272)
4 UIKitCore 0x1ee62ae9c -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] + 264 (UIViewControllerTransitioning.m:1121)
5 UIKitCore 0x1ee62725c -[_UIViewControllerTransitionContext _runAlongsideCompletions] + 140 (UIViewControllerTransitioning.m:374)
6 UIKitCore 0x1ee626f34 -[_UIViewControllerTransitionContext completeTransition:] + 132 (UIViewControllerTransitioning.m:286)
7 UIKitCore 0x1ee6371f4 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke.118 + 740 (_UINavigationParallaxTransition.m:393)
8 UIKitCore 0x1ef032d1c -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 752 (UIView.m:12852)
9 UIKitCore 0x1ef009a74 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 312 (UIView.m:0)
10 UIKitCore 0x1ef00a048 -[UIViewAnimationState animationDidStop:finished:] + 296 (UIView.m:2111)
11 UIKitCore 0x1ef00a0e8 -[UIViewAnimationState animationDidStop:finished:] + 456 (UIView.m:2130)
12 QuartzCore 0x1c671f3c8 CA::Layer::run_animation_callbacks(void*) + 284 (CALayer.mm:6680)
13 libdispatch.dylib 0x1c1c0d7d4 _dispatch_client_callout + 16 (object.m:511)
14 libdispatch.dylib 0x1c1bbb008 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1068 (inline_internal.h:2441)
15 CoreFoundation 0x1c2160b20 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1813)
16 CoreFoundation 0x1c215ba58 __CFRunLoopRun + 1924 (CFRunLoop.c:3113)
17 CoreFoundation 0x1c215afb4 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
18 GraphicsServices 0x1c435d79c GSEventRunModal + 104 (GSEvent.c:2245)
19 UIKitCore 0x1eeba7c38 UIApplicationMain + 212 (UIApplication.m:4353)
20 therapeutic-listening 0x100b83380 main + 88 (main.m:16)
21 libdyld.dylib 0x1c1c1e8e0 start + 4 (:-1)
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001c1d6b0dc __pthread_kill + 8 (:-1)
1 libsystem_pthread.dylib 0x00000001c1de4094 pthread_kill$VARIANT$mp + 380 (pthread.c:1492)
2 libsystem_c.dylib 0x00000001c1cc3ea8 abort + 140 (abort.c:94)
3 libc++abi.dylib 0x00000001c1390788 abort_message + 132 (abort_message.cpp:75)
4 libc++abi.dylib 0x00000001c1390934 default_terminate_handler() + 308 (cxa_default_handlers.cpp:68)
5 libobjc.A.dylib 0x00000001c13a7e00 _objc_terminate() + 124 (objc-exception.mm:693)
6 libc++abi.dylib 0x00000001c139c838 std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:66)
7 libc++abi.dylib 0x00000001c139c8c4 std::terminate() + 84 (cxa_handlers.cpp:97)
8 libdispatch.dylib 0x00000001c1c0d7e8 _dispatch_client_callout + 36 (object.m:514)
9 libdispatch.dylib 0x00000001c1bbb008 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1068 (inline_internal.h:2441)
10 CoreFoundation 0x00000001c2160b20 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1813)
11 CoreFoundation 0x00000001c215ba58 __CFRunLoopRun + 1924 (CFRunLoop.c:3113)
12 CoreFoundation 0x00000001c215afb4 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
13 GraphicsServices 0x00000001c435d79c GSEventRunModal + 104 (GSEvent.c:2245)
14 UIKitCore 0x00000001eeba7c38 UIApplicationMain + 212 (UIApplication.m:4353)
15 therapeutic-listening 0x0000000100b83380 main + 88 (main.m:16)
16 libdyld.dylib 0x00000001c1c1e8e0 start + 4 (:-1)
I am working on a project with Xcode. In the schematic of my project, I checked the Debug executable box. There is no problem in the emulator. But when I run my project on my own device, I get different pid code errors and the application does not open. However, when the Debug executable box is unchecked, my project works. But I am unable to debug my code without the Debug executable checked.
Can someone help me?
Xcode version is 15.2 and my device version is 17.2.
Methods I have tried;
Delete DerivedData
Closing the Debug executable box
Try different device
sudo DevToolsSecurity -enable
Good morning,
My problem is the following:
I have my app published in the store which works correctly on all Apple devices except those with iOS 12.
The app crashes on startup, the problem only occurs in the release version, in debug it works correctly even on a physical device with iOS 12.
The build was created with Xcode 15
I have been having intermittent Crashes but I still have no idea why that is happening.
Seems to happen right after I initialize a Controller from Storyboard.
crashReport.crash
Let me know if you have any inputs on fixing this crash. Thanks!!
[crashReport.crash]
Any help in debugging this is appreciated. Thanks
Hello there, i would like to ask a question related xcode build confinguration.
So i have create a Common.framework that i used in other project, because of the .framework file is quite large then i want to generate Common.framework but with Generate Debug Symbols is NO, and the result Common.framework size is reduced
The question is there any negative impact that will happen to my app that use Common.framework?
When my Swift program stops at a breakpoint values for some of the variables that appear to be available for inspection are shown, but most are not. The variables themselves are listed, but no values are shown when I look at them. The code snippet is the addItem function in the default ContentView for a Swift project, somewhat modified for my particular purpose.
Stopping at a breakpoint in this function I am able to see the value for the variable zz, but properties of the Ledger and LedgerEntry structures seem to have no values. I can inspect them, but they all show 'Value: None'. Even those values that have been explicitly defined are not displayed.
Here's what I see when I print the debugger's description of these couple of properties:
Printing description of newEntry._ix:
(PennyJar.LedgerEntry._SwiftDataNoType) _ix = {}
Printing description of newLedger._type:
(PennyJar.Ledger._SwiftDataNoType) _type = {}
I have read what I can find on the forums, and I've checked all the suggested build parameters, which all seem to be correctly indicating a Debug build with no Optimization.
I would really appreciate any guidance from someone who knows these tools... Thanks in advance!
@Model
final class Ledger {
var id = UUID()
var name: String
var type: String
var entries: [LedgerEntry]
init(name: String) {
self.name = name
self.type = ""
self.entries = []
}
}
@Model
final class LedgerEntry {
let id = UUID()
var ix: Int = 0
var date: String
var chkno: String
var payee: String
var category: String
var debit: Float
var credit: Float
init(ledger: Ledger) {
self.ix = 0
self.date = "1/21/24"
self.chkno = ""
self.payee = ""
self.category = ""
self.debit = 0
self.credit = 0
}
}
private func addItem() {
withAnimation {
let zz = 27
let newLedger = Ledger(name: "New Ledger")
let newEntry = LedgerEntry(ledger: newLedger)
newEntry.payee = "Initial Balance"
newEntry.ix = 1
newLedger.entries.append(newEntry)
modelContext.insert(newLedger)
}
}
My App, WPuzzle, rejected by Apple Review Team. The reason given is very unclear, “We were unable to review your app as it crashed on launch.”
I can't find the actual reason of crashing by reading the crash logs. I have read many documents and blog, however, I don't understand the detailed information in crash logs.
Moreover, there is no crash or error when I test my app on my iPad and iPhone simulators.
I decide to ask help. Thanks in advance.
Crash Logs are stored in this links:
https://drive.google.com/drive/folders/1H2u_YJ35o5VCyXzlwAoZ3lmLjKc7kHTf?usp=sharing
I was making the cancel button of the memo screen in my iOS memo application. But, when I clicked the cancel button, Thread 1: EXC_BREAKPOINT (code=1, subcode=0x18855e560) error appeared. I used dismiss(animate: true, completion: nil) code
ComposeViewController Code
import UIKit
class ComposeViewController: UIViewController {
@IBAction func close(_ sender: Any) {
dismiss(animated: true, completion: nil). //this code was problem
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
//something more that is comment code '//'
}
Hey there,
we are seeing following crash in our firebase cras console:
Fatal Exception: NSInvalidArgumentException
-[_UISnapshotWindow actualSceneBounds]: unrecognized selector sent to instance 0x10ff840e0
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0xec69c __exceptionPreprocess
1 libobjc.A.dylib 0x2bc80 objc_exception_throw
2 CoreFoundation 0x17cfdc +[NSObject(NSObject) _copyDescription]
3 UIKitCore 0xe31bcc -[UIResponder doesNotRecognizeSelector:]
4 CoreFoundation 0x31e08 ___forwarding___
5 CoreFoundation 0x172950 _CF_forwarding_prep_0
6 UIKitCore 0x265bd8 -[UIUndoGestureInteraction didMoveToView:]
7 UIKitCore 0xb3510 _setInteractionView
8 UIKitCore 0xb345c -[UIView(Dragging) addInteraction:]
9 UIKitCore 0x13d1d4 -[UIEditingOverlayViewController _addInteractions]
10 UIKitCore 0x13c9b0 -[UIViewController _setViewAppearState:isAnimating:]
11 UIKitCore 0x18ff90 __52-[UIViewController _setViewAppearState:isAnimating:]_block_invoke_2
12 UIKitCore 0x18fe28 __52-[UIViewController _setViewAppearState:isAnimating:]_block_invoke
13 CoreFoundation 0x353f4 __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
14 CoreFoundation 0x66670 -[__NSArrayI enumerateObjectsWithOptions:usingBlock:]
15 UIKitCore 0x13cb10 -[UIViewController _setViewAppearState:isAnimating:]
16 UIKitCore 0xad8f0 -[UIViewController __viewDidAppear:]
17 UIKitCore 0x1bc624 __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke
18 UIKitCore 0xadad0 -[UIViewController _executeAfterAppearanceBlock]
19 UIKitCore 0xab35c -[_UIAfterCACommitBlock run]
20 UIKitCore 0xab140 -[_UIAfterCACommitQueue flush]
21 UIKitCore 0xab058 _runAfterCACommitDeferredBlocks
22 UIKitCore 0xaade4 _cleanUpAfterCAFlushAndRunDeferredBlocks
23 UIKitCore 0xaace0 _UIApplicationFlushCATransaction
24 UIKitCore 0xaa7e4 _UIUpdateSequenceRun
25 UIKitCore 0xa9ed4 schedulerStepScheduledMainSection
26 UIKitCore 0xa9f90 runloopSourceCallback
27 CoreFoundation 0x3712c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
28 CoreFoundation 0x363a8 __CFRunLoopDoSource0
29 CoreFoundation 0x34b5c __CFRunLoopDoSources0
30 CoreFoundation 0x33898 __CFRunLoopRun
31 CoreFoundation 0x33478 CFRunLoopRunSpecific
32 GraphicsServices 0x34f8 GSEventRunModal
33 UIKitCore 0x22c62c -[UIApplication _run]
34 UIKitCore 0x22bc68 UIApplicationMain
35 appname*** 0x40bc main + 3 (main.swift:3)
36 ??? 0x1c48c2dcc (Fehlt)
What we can see is, that
public func userNotificationCenter(
_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void
) { }
is being executed while the app has the state background. After entering a ViewController, the app seems to crash.
Does anybody had a similar crashlog and maybe a approach how we could solve it?
I have a table with a filter. The table only displays the table rows that matches the filter. In the javascript code, I have a filterInteraction() function that have a commonElements list and display the table rows if they are included in the commonElements list. In my html, when the user click, the filterInteraction() will be triggered. Here's part of my filterInteraction() function (the sensitive code is removed): "
function filterInteraction(){
let searchList = searchResult();
let checkboxList = checkboxResult();
let commonElements = searchList.filter(element => checkboxList.includes(element));
console.log("commonElements ==========", commonElements)
var table, tr, i;
table = document.getElementById("employeeTable");
let rows = table.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
for (i = 0; i < rows.length; i++) {
let currentName = rows[i].getElementsByTagName("td")[0].textContent.trim();
if(commonElements.includes(currentName)){
rows[i].style.visibility = "visible";
// rows[i].removeAttribute("hidden");
// rows[i].style.display = "";
}
else{
rows[i].style.visibility = "hidden";
// rows[i].setAttribute("hidden", true);
// rows[i].style.display = "none";
}
}
countPart(commonElements.length);
}".
In this function, I printed the commonElements list, and the list is always correct. However, for the display, it's switching between displaying nothing and displaying the correct rows. (When entering the Safari, the first click on the filter makes the table empty, but the second click displays the correct rows, the next click will make the table displays nothing again .... ). Even during the time that the table display nothing, the commonElements list printed in console is still correct, which means the function does have the correct table rows, but they are not displayed. I tried three different ways to display the table row: "rows[i].style.visibility = "visible"; rows[i].removeAttribute("hidden"); rows[i].style.display = "";". None of them could work without the bug I mentioned above. I tested my filter on Chrome, FireFox, and IE, and my filter works perfectly on them. Any possible way to solve the issue on Safari? Why it has the display bug like this in Safari? Really need help!!! Thanks
My App, WPuzzle, rejected by Apple Review Team. The reason given is very unclear, “We were unable to review your app as it crashed on launch.”
I can't find the actual reason of crashing by reading the crash logs. I have read many documents and blog, however, I don't understand the detailed information in crash logs.
Moreover, there is no crash or error when I test my app on my iPad and iPhone simulators.
Please help me.
I've been seeing this crash for a few months now, and have not been able to reproduce this or make sense of the stack trace. I would really appreciate any help deciphering what the stack trace is telling me. I'm seeing mention of GRDB and from what I can tell, it looks like this is happening right as the app launches? The app does do some writing to GRDB on app launch, if that is of any relevance.
Please let me know what would be a good approach to making sense of this stack trace and investigating this crash. Thank you so much in advance.
Stack trace:
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001d7159178 mach_msg2_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001d7158f10 mach_msg2_internal + 80 (mach_msg.c:201)
2 libsystem_kernel.dylib 0x00000001d7158e28 mach_msg_overwrite + 436 (mach_msg.c:0)
3 libsystem_kernel.dylib 0x00000001d7158c68 mach_msg + 24 (mach_msg.c:323)
4 CoreFoundation 0x000000018fa2fb1c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5 CoreFoundation 0x000000018fa2da14 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6 CoreFoundation 0x000000018fa2d478 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7 GraphicsServices 0x00000001d2fae4f8 GSEventRunModal + 164 (GSEvent.c:2196)
8 UIKitCore 0x0000000191e5162c -[UIApplication _run] + 888 (UIApplication.m:3685)
9 UIKitCore 0x0000000191e50c68 UIApplicationMain + 340 (UIApplication.m:5270)
10 Ruby 0x0000000104f476d0 main + 64 (AppDelegate.swift:28)
11 dyld 0x00000001b2766dcc start + 2240 (dyldMain.cpp:1269)
Thread 1 name:
Thread 1:
0 libsystem_kernel.dylib 0x00000001d7166e5c guarded_pwrite_np + 8 (:-1)
1 libsqlite3.dylib 0x00000001b8e5a3e4 seekAndWrite + 456 (sqlite3.c:44224)
…
40 libdispatch.dylib 0x00000001979f1300 _dispatch_client_callout + 20 (object.m:561)
41 libdispatch.dylib 0x0000000197a02dbc _dispatch_root_queue_drain + 864 (queue.c:7051)
42 libdispatch.dylib 0x0000000197a033ec _dispatch_worker_thread2 + 156 (queue.c:7119)
43 libsystem_pthread.dylib 0x00000001f9a1b928 _pthread_wqthread + 228 (pthread.c:2642)
44 libsystem_pthread.dylib 0x00000001f9a1ba04 start_wqthread + 8 (:-1)
Thread 2:
0 libsystem_pthread.dylib 0x00000001f9a1b9fc start_wqthread + 0 (:-1)
Thread 3:
0 libsystem_pthread.dylib 0x00000001f9a1b9fc start_wqthread + 0 (:-1)
Thread 4 name:
Thread 4:
0 libsystem_kernel.dylib 0x00000001d7159178 mach_msg2_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001d7158f10 mach_msg2_internal + 80 (mach_msg.c:201)
2 libsystem_kernel.dylib 0x00000001d7158e28 mach_msg_overwrite + 436 (mach_msg.c:0)
3 libsystem_kernel.dylib 0x00000001d7158c68 mach_msg + 24 (mach_msg.c:323)
4 CoreFoundation 0x000000018fa2fb1c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5 CoreFoundation 0x000000018fa2da14 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6 CoreFoundation 0x000000018fa2d478 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7 Foundation 0x000000018e9c048c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373)
8 Foundation 0x000000018e9ed74c -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420)
9 UIKitCore 0x0000000191db34a8 -[UIEventFetcher threadMain] + 420 (UIEventFetcher.m:1208)
10 Foundation 0x000000018ea43de0 __NSThread__start__ + 732 (NSThread.m:991)
11 libsystem_pthread.dylib 0x00000001f9a1c4d4 _pthread_start + 136 (pthread.c:904)
12 libsystem_pthread.dylib 0x00000001f9a1ba10 thread_start + 8 (:-1)
Thread 5 name:
Thread 5:
0 libsystem_kernel.dylib 0x00000001d7159178 mach_msg2_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001d7158f10 mach_msg2_internal + 80 (mach_msg.c:201)
2 libsystem_kernel.dylib 0x00000001d7158e28 mach_msg_overwrite + 436 (mach_msg.c:0)
3 libsystem_kernel.dylib 0x00000001d7158c68 mach_msg + 24 (mach_msg.c:323)
4 CoreFoundation 0x000000018fa2fb1c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5 CoreFoundation 0x000000018fa2da14 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6 CoreFoundation 0x000000018fa2d478 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7 CFNetwork 0x0000000190d2b060 +[__CFN_CoreSchedulingSetRunnable _run:] + 384 (CoreSchedulingSet.mm:1479)
8 Foundation 0x000000018ea43de0 __NSThread__start__ + 732 (NSThread.m:991)
9 libsystem_pthread.dylib 0x00000001f9a1c4d4 _pthread_start + 136 (pthread.c:904)
10 libsystem_pthread.dylib 0x00000001f9a1ba10 thread_start + 8 (:-1)
Thread 6:
0 libsystem_pthread.dylib 0x00000001f9a1b9fc start_wqthread + 0 (:-1)
Thread 7 name:
Thread 7:
0 libsystem_kernel.dylib 0x00000001d7159178 mach_msg2_trap + 8 (:-1)
1 libsystem_kernel.dylib 0x00000001d7158f10 mach_msg2_internal + 80 (mach_msg.c:201)
2 libsystem_kernel.dylib 0x00000001d7158e28 mach_msg_overwrite + 436 (mach_msg.c:0)
3 libsystem_kernel.dylib 0x00000001d7158c68 mach_msg + 24 (mach_msg.c:323)
4 FirebaseCrashlytics 0x00000001065bf1f4 FIRCLSMachExceptionReadMessage + 56 (FIRCLSMachException.c:192)
5 FirebaseCrashlytics 0x00000001065bf1f4 FIRCLSMachExceptionServer + 104 (FIRCLSMachException.c:168)
6 libsystem_pthread.dylib 0x00000001f9a1c4d4 _pthread_start + 136 (pthread.c:904)
7 libsystem_pthread.dylib 0x00000001f9a1ba10 thread_start + 8 (:-1)
Thread 8:
0 libsystem_pthread.dylib 0x00000001f9a1b9fc start_wqthread + 0 (:-1)
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000010004005 x1: 0x0000000507000806 x2: 0x0000000200000000 x3: 0x0000250300000000
x4: 0x0000000000000000 x5: 0x0000250300000000 x6: 0x0000000000000002 x7: 0x00000000ffffffff
x8: 0xfffffffffffffbbf x9: 0x0000000000002503 x10: 0x0000000000000000 x11: 0x0000000000000001
x12: 0x0000000000002503 x13: 0x0000000000050fc8 x14: 0x0000000000000000 x15: 0x0000000000000000
x16: 0xffffffffffffffd1 x17: 0x0000000197a390e4 x18: 0x0000000000000000 x19: 0x00000000ffffffff
x20: 0x0000000000000002 x21: 0x0000250300000000 x22: 0x0000000000000000 x23: 0x0000250300000000
x24: 0x000000016b00e7b8 x25: 0x0000000200000000 x26: 0x0000000507000806 x27: 0x0000000507000806
x28: 0x0000000107000806 fp: 0x000000016b00e720 lr: 0x00000001d7158f10
sp: 0x000000016b00e6d0 pc: 0x00000001d7159178 cpsr: 0x1000
esr: 0x56000080 Address size fault
Hey there!
We recently release our app, and spotted a couple of crash reports in the last 2 released versions. It happened to 2 different users with the same iOS major version:
iPhone15.3, OS 17.1.2
iPhone15.3, OS 17.2.1
Attaching 2 different crash reports on (what seems to be) the same issue.
(the app name is changed for the security reasons):
After reading multiple StackOverflow, Github and Apple support threads on similar issue I wanted to add a couple of notes for the context:
our app is written in TypeScript
it's packed via Capacitor into iOS and Android bundles and is served via built-in browser
re/ CameraUI from the crash report - we have a functionality of picking the image from gallery, or using the camera to take a photo, if it's related
re/ permissions for that - we have:
<key>Privacy - Photo Library Usage Description</key>
<key>Privacy - Camera Usage Description</key>
in the Info.plist file set to:
<string>$(PRODUCT_NAME) photo use</string> and
<string>$(PRODUCT_NAME) camera use</string> respectively
Would appreciate any clues and ideas! Thanks in advance!
I can read the scrollPosition correctly, but scrollTo() doesn't work.
iOS 17, Xcode 15.2. Code like this below(can directly copy and paste):
import SwiftUI
struct PositionTest: View {
@State private var weathers = Weather.samples
@State private var scrollPosition: Weather.ID?
@State private var isTaped: Bool = false
var body: some View {
VStack {
Text("Scroll Position: " + (scrollPosition ?? "Cupertino"))
if !isTaped {
CollapsedView(
weathers: $weathers,
scrollPosition: $scrollPosition,
isTaped: $isTaped
)
} else {
ExpandedView(
weathers: $weathers,
scrollPosition: $scrollPosition,
isTaped: $isTaped
)
}
}
.font(.title)
.fontWeight(.semibold)
.animation(.default, value: isTaped)
}
}
#Preview {
PositionTest()
}
struct CollapsedView: View {
@Binding var weathers: [Weather]
@Binding var scrollPosition: Weather.ID?
@Binding var isTaped: Bool
var body: some View {
ScrollViewReader { proxy in
ScrollView {
VStack(spacing: 20) {
ForEach(weathers) { weather in
Text(weather.name)
.frame(width: 350, height: 227)
.foregroundStyle(.white)
.background(.blue.gradient)
.cornerRadius(40)
.id(weather.id as Weather.ID?)
.onTapGesture { isTaped.toggle() }
}
}
.frame(maxWidth: .infinity)
.scrollTargetLayout()
}
.scrollIndicators(.hidden)
.scrollTargetBehavior(.viewAligned)
.scrollPosition(id: $scrollPosition, anchor: .center)
.onAppear { proxy.scrollTo(scrollPosition, anchor: .center) }
}
}
}
struct ExpandedView: View {
@Binding var weathers: [Weather]
@Binding var scrollPosition: Weather.ID?
@Binding var isTaped: Bool
var body: some View {
ScrollViewReader { proxy in
ScrollView {
VStack(spacing: 20) {
ForEach(weathers) { weather in
Text(weather.name)
.frame(width: 250, height: 227)
.foregroundStyle(.white)
.background(.indigo.gradient)
.clipShape(.circle)
.id(weather.id as Weather.ID?)
.onTapGesture { isTaped.toggle() }
}
}
.frame(maxWidth: .infinity)
.scrollTargetLayout()
}
.scrollIndicators(.hidden)
.scrollTargetBehavior(.viewAligned)
.scrollPosition(id: $scrollPosition, anchor: .center)
.onAppear { proxy.scrollTo(scrollPosition, anchor: .center) }
}
}
}
struct Weather: Identifiable {
var id: String { name }
let name: String
let temp: Int
static let samples = [
Weather(name: "Cupertino", temp: 12),
Weather(name: "New York", temp: 13),
Weather(name: "ShangHai", temp: 14),
Weather(name: "London", temp: 15),
Weather(name: "Las Vegas", temp: 16),
]
}
I found if I simply change the VStack to LazyVStack in both CollapsedView() and ExpandedView(), the scrollTo() method works fine.
But in my project, for some reason I don't want to use LazyVStack, just want to use VStack, is there any way to make scorllTo() works in VStack?