Skip to content
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

App Crashes in iPad due to transition #648

Closed
kirthika opened this issue Sep 23, 2020 · 10 comments
Closed

App Crashes in iPad due to transition #648

kirthika opened this issue Sep 23, 2020 · 10 comments

Comments

@kirthika
Copy link

I have read the guidelines for contributing and I understand

  • [yes ] My issue is happening in the latest version of SideMenu (older versions are no longer maintained).
  • [yes ] My issue was not solved in the README.
  • [yes] My issue can not be answered on stackoverflow.com.
  • [yes ] My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
  • [yes] My issue is reproducible in the demo project.

Describe the bug
When app goes to background/when we try to open an external link and then when we come back to our app, there is a crash in SideMenuTransitionController (at presentationController.dismissalTransitionWillBegin() of transitionWillBegin) in iPad.

To Reproduce
Steps to reproduce the behavior:

Create an option under Push View Controller of Left Menu that takes to an external link.
Click on the above option.
Come back to Side Menu app and click on Left Menu.

Expected behavior
Side Menu does not crash in iPhone and behaves as expected. However, crash occurs in iPad.

Video
CrashRecording.zip

Additional context
Please find two different crash logs from the actual app in which I used the Side Menu :

Crashed: com.apple.main-thread
EXC_BREAKPOINT 0x000000010172cf4c
0
SideMenu
SideMenuTransitionController.swift - Line 104
closure #1 in SideMenuNavigationController.viewWillTransition(to:with:) + 104
1
SideMenu

  • Line 4323856260
    thunk for @escaping @callee_guaranteed (@guaranteed UIViewControllerTransitionCoordinatorContext) -> () + 4323856260
    2
    UIKitCore
    -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] + 264
    3
    UIKitCore
    -[_UIViewControllerTransitionContext __runAlongsideAnimations] + 256
    4
    UIKitCore
    -[_UIWindowAnimationController animateTransition:] + 328
    5
    UIKitCore
    -[UIWindow _adjustSizeClassesAndResizeWindowToFrame:] + 932
    6
    UIKitCore
    -[UIWindow _resizeWindowFrameToSceneBoundsIfNecessary] + 248
    7
    UIKitCore
    __78-[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:]_block_invoke + 388
    8
    UIKitCore
    __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke_2 + 172
    9
    UIKitCore
    +[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:forScene:] + 204
    10
    UIKitCore
    __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke + 164
    11
    UIKitCore
    -[_UIWindowRotationAnimationController animateTransition:] + 492
    12
    UIKitCore
    -[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 580
    13
    UIKitCore
    -[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 1420
    14
    UIKitCore
    -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 408
    15
    UIKitCore
    -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 128
    16
    UIKitCore
    -[_UIFullscreenPresentationController _placeCounterRotationViewWithView:inWindow:fromOrientation:toOrientation:force:] + 504
    17
    UIKitCore
    -[_UIFullscreenPresentationController _adjustOrientationIfNecessaryInWindow:forViewController:preservingViewController:] + 880
    18
    UIKitCore
    -[UIPresentationController _presentWithAnimationController:interactionController:target:didEndSelector:] + 932
    19
    UIKitCore
    -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1412
    20
    UIKitCore
    -[UIViewController _presentViewController:withAnimationController:completion:] + 4228
    21
    UIKitCore
    __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 104
    22
    UIKitCore
    -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 508
    23
    UIKitCore
    -[UIViewController _presentViewController:animated:completion:] + 196
    24
    UIKitCore
    -[UIViewController presentViewController:animated:completion:] + 164

Crashed: com.apple.main-thread
EXC_BREAKPOINT 0x0000000101944f4c
0
SideMenu
(Missing)
1
SideMenu
(Missing)
2
UIKitCore
-[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] + 264
3
UIKitCore
-[_UIViewControllerTransitionContext __runAlongsideAnimations] + 256
4
UIKitCore
-[_UIWindowAnimationController animateTransition:] + 328
5
UIKitCore
-[UIWindow _adjustSizeClassesAndResizeWindowToFrame:] + 932
6
UIKitCore
-[UIWindow _resizeWindowFrameToSceneBoundsIfNecessary] + 248
7
UIKitCore
__78-[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:]_block_invoke + 388
8
UIKitCore
__58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke_2 + 172
9
UIKitCore
+[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:forScene:] + 204
10
UIKitCore
__58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke + 164
11
UIKitCore
-[_UIWindowRotationAnimationController animateTransition:] + 492
12
UIKitCore
-[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 580
13
UIKitCore
-[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 1420
14
UIKitCore
-[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 408
15
UIKitCore
-[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 128
16
UIKitCore
-[_UIFullscreenPresentationController _placeCounterRotationViewWithView:inWindow:fromOrientation:toOrientation:force:] + 504
17
UIKitCore
-[_UIFullscreenPresentationController _adjustOrientationIfNecessaryInWindow:forViewController:preservingViewController:] + 880
18
UIKitCore
-[UIPresentationController _presentWithAnimationController:interactionController:target:didEndSelector:] + 932
19
UIKitCore
-[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1412
20
UIKitCore
-[UIViewController _presentViewController:withAnimationController:completion:] + 4228
21
UIKitCore
__63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 104
22
UIKitCore
-[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 508
23
UIKitCore
-[UIViewController _presentViewController:animated:completion:] + 196
24
UIKitCore
-[UIViewController presentViewController:animated:completion:] + 164

In case of any clarification, please feel free to reach out to me.
Thanks.

Here's the minimal modified version of demo(example[SideMenu-master.zip])
SideMenu-master.zip

@kirthika kirthika changed the title https://github.com/jonkykong/SideMenu/issues/631 App Crashes in iPad due to transition Sep 23, 2020
@2h4u
Copy link

2h4u commented Sep 24, 2020

I have exactly the same issue, also with the newest version of SideMenu and also only on iPad.
It also is 100% reproducible:
open the app on an iPad -> open the SideDrawer -> send the app to the background -> open the app again (now the sideDrawer is gone in contrast if I do the same with an iPhone) -> try to open the sideDrawer again -> crash

@2h4u
Copy link

2h4u commented Sep 24, 2020

@kirthika I made a PR which fixes the issues i had, can you try it out and tell us if it also fixes your issues?
#650

@kirthika
Copy link
Author

Thanks @2h4u I'm working on it..

@kirthika
Copy link
Author

This solves my issue though, I wonder if this could be available in a newer version(release) so that I can update my pod files.

@2h4u
Copy link

2h4u commented Sep 28, 2020

@kirthika thanks for trying it out
Of course it would be beneficial if a fix would be released but I am not a 100% sure if this really fixes the issue or if it just fixes the "symptoms". Maybe one of the contributors can take a look at it?

But in the mean time, you can still use my fix by simply putting these lines into you podfile:

  # Change the SideMenu source back to the official one as soon as the issue if fix:
  # https://github.com/jonkykong/SideMenu/issues/648
  pod 'SideMenu', :git => 'https://github.com/2h4u/SideMenu.git', :branch => 'crash-fix-#648'

Of course if you do not trust my source (which you should not since i am a random person on the internet 😅), you can simply fork the original project and apply the fix to it, so you can use it instead of my fork.

@kirthika
Copy link
Author

@2h4u Got to follow some standards indeed. Anyways thanks much for the timely solution :)

@kirthika
Copy link
Author

@jonkykong Amidst your busy schedule, by any chance could this be addressed in your upcoming release?

@jonkykong
Copy link
Owner

Please update to 6.5.0.

@kirthika
Copy link
Author

Updating to 6.5.0 has not solved my issue. Please verify the same in example code.

Uploading Sidemenu_6.5_fix.mov.zip…

@2h4u
Copy link

2h4u commented Oct 27, 2020

Updating to 6.5.0 has fixed my crash issue but introduced a new UI glitch.
If an iPad-user closes the app while the sideDrawer is still active/visible, the next time the user tries to open the sideDrawer the viewController behind, the now visible, sideDrawer rotates by 90°, thats really ugly.
I made a short video so you can better understand what i mean:
Screenrecord.mov.zip

I fear that #642 caused this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants