-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in installMaskingView #348
Comments
Any reason why you don’t go with 7.0.0? |
Nah, I've seen that 7.0.1 needed Xcode 11 and I supposed it was also the case for the 7.0.0. I'll make the update if possible. |
I have a similar issue in 7.0.0.
It crashes with the exception:
My SwiftMessages are displayed using the block creation pattern SwiftMessages.show(config, {}), inside UIViewController subclasses that are the root view controller of a UINavigationController that is in the viewControllers of a UITabBarController. This happens to approximately 0.18% of users in production. I've not yet been able to reproduce it myself. I'm upgrading to 7.0.1 this release and will keep thread apprised. |
Ugh...18% of users is the worst kind of crash since my chance of reproducing it is very slim :( Any chance that they're jailbroken? Or any other commonalities? I've had crashes with jailbroken users in the past. |
Here are some additional infos from Crashlytics for this crash: While the audience of the app is: It looks it only crashes on iPhone, and has a bit more probability to happen using iOS 13. |
My best guess is |
Ah my bad, I made a misstake in my original post. |
Can you use |
Unfortunately using a .window() context will make the message overlap the UITabBar which we don't want. |
I have some more information to add to this issue, maybe it'll help others. • 7.0.1 does not prevent the crashes. • I finally managed to reproduce the issue in my debugger. What appears to be happening to me is:
In this case, fixing the database issue prevented the two animations from playing simultaneously when they shouldn't have, which prevents the issue. I have released an update with this fix, and will update the thread again if i see any more of these crashes. |
Thanks for the update. Just be clarify one thing:
When you use this presentation context, the message is displayed in the view you specify. It doesn’t have any reason to try and find a tab bar. |
Okay, if it doesn't try to find a tab bar through .view, then it would have to be one of my other .viewController() presentation contexts (we use SwiftMessage a lot) that crashed... and I can't explain how it's finding a tabBar reference that's not associated with the viewController that is used as the presentationContext. Unless the fact that its during that animation transition is the problem, but all my SwiftMessages are displayed in viewDidAppear or later. It's a really weird crash. I honestly would've blamed the crash i could reproduce in XCode (described above) on the database issue, but it crashes in the InstallMaskingView every time. If it was just the database crashing on a background thread, i'd get some different stack traces occasionally. My version with this fix has been live for 40 hours now, without one of these crashes. That is positive. |
I am still seeing some of these crashes. I'm going to look for other places that SwiftMessages might be created by viewControllers during a custom animated transition. |
I've managed to reproduce this once on my device: I have some view controllers that can both show a .bottom aligned SwiftMessage and push another view controller in viewDidAppear In cases where both happen, and the pushed view controller has .hideBottomBarOnPush = true, sometimes there's a timing issue that causes this crash. I'm going to make these items mutually exclusive to prevent this issue. |
@MaoDaAmargura thanks for sharing your findings! |
Hello :)
I've posted almost 1 year ago in #253 an issue where my app crashed due to autolayout issue.
At the time i've updated SwiftMessage to 6.0.2 and the crash is still there, but slightly differs from the old one.
With SwiftMessage 4.1.4:
With SwiftMessage 6.0.2:
Here is an example of the way I show a message:
Messages that seems to crash are presented in the
viewDidAppear
of aUITabBarViewController
subclass, with aUINavigationController
as parent of the messageUpdating to SwiftMessage 7.0.1 isn't an option for now as it requires Xcode 11 which I don't plan to use really soon (bugs, project compatibility, etc.).
The text was updated successfully, but these errors were encountered: