question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NSInvalidArgumentException: Application tried to present modally an active controller <RNSScreen: 0x105075810>

See original GitHub issue

Description

I don’t know, how to reproduce, but I am getting this issue on the sentry log here are the logs, which I am getting on sentry

NSInvalidArgumentException: Application tried to present modally an active controller <RNSScreen: 0x105075810>.
  CoreFoundation      0x203b1a98c  __exceptionPreprocess
  libobjc.A           0x202cf39f4  objc_exception_throw
  UIKitCore           0x22fed1ec4  -[UIViewController _presentViewController:withAnimationController:completion:]
  UIKitCore           0x22fed44ac  __63-[UIViewController _presentViewController:animated:completion:]_block_invoke_2
  UIKitCore           0x2308f38ec  +[UIView(Animation) performWithoutAnimation:]
  UIKitCore           0x22fed440c  __63-[UIViewController _presentViewController:animated:completion:]_block_invoke
  UIKitCore           0x22fed48a0  -[UIViewController _performCoordinatedPresentOrDismiss:animated:]
  UIKitCore           0x22fed42fc  -[UIViewController _presentViewController:animated:completion:]
  UIKitCore           0x22fed455c  -[UIViewController presentViewController:animated:completion:]
  OnShobbak           0x10121e2b0  facebook::react::JSIExecutor::defaultTimeoutInvoker
  OnShobbak           0x10121d65c  facebook::react::JSIExecutor::defaultTimeoutInvoker
  OnShobbak           0x10121d280  facebook::react::JSIExecutor::defaultTimeoutInvoker
  UIKitCore           0x2308f875c  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x23088735c  -[UIScrollView _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308f83b0  -[UIView(Internal) _didMoveFromWindow:toWindow:]
  UIKitCore           0x2308ebdc0  __45-[UIView _postMovedFromSuperview:]_block_invoke
  UIKitCore           0x2308ebc88  -[UIView(Hierarchy) _postMovedFromSuperview:]
  UIKitCore           0x2308fb0f4  -[UIView(Internal) _addSubview:positioned:relativeTo:]
  UIKitCore           0x22fee7228  __67-[UIViewControllerBuiltinTransitionViewAnimator animateTransition:]_block_invoke_2
  UIKitCore           0x2308f38ec  +[UIView(Animation) performWithoutAnimation:]
  UIKitCore           0x22fee71a8  __67-[UIViewControllerBuiltinTransitionViewAnimator animateTransition:]_block_invoke
  UIKitCore           0x2308f5258  +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:]
  UIKitCore           0x2308f5798  +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:]
  UIKitCore           0x22fee685c  -[UIViewControllerBuiltinTransitionViewAnimator animateTransition:]
  UIKitCore           0x22fdf0704  __56-[UIPresentationController runTransitionForCurrentState]_block_invoke
  UIKitCore           0x2304750a8  _runAfterCACommitDeferredBlocks
  UIKitCore           0x230463bf8  _cleanUpAfterCAFlushAndRunDeferredBlocks
  UIKitCore           0x230490a68  _afterCACommitHandler
  CoreFoundation      0x203aabd04  __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
  CoreFoundation      0x203aa6a2c  __CFRunLoopDoObservers
  CoreFoundation      0x203aa6fa8  __CFRunLoopRun
  CoreFoundation      0x203aa67bc  CFRunLoopRunSpecific
  GraphicsServices    0x205ca7798  GSEventRunModal
  UIKitCore           0x230469c34  UIApplicationMain
  OnShobbak           0x100fb1f74  <redacted>
  libdyld             0x20356a8dc  start

Screenshots

image

Steps To Reproduce

dont know

Expected behavior

this error should not be occur

Actual behavior

n/a

Reproduction

n/a

Platform

  • iOS
  • Android
  • Web
  • Windows
  • tvOS

Workflow

  • Managed workflow
  • Bare workflow

Package versions

package version
react-native 0.66.4
@react-navigation/native 6.0.6
@react-navigation/native-stack 6.2.5
react-native-screens 3.10.1
react-native-safe-area-context 3.3.2
react-native-gesture-handler 2.1.0
react-native-reanimated 2.3.1
expo n/a

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
maximewimcommented, Mar 2, 2022

I’ll try later to provide a reproduction. Just to help, I solve the problem using ‘navigate’ instead of ‘replace’. So seems link to replace directly.

1reaction
numandev1commented, Jan 27, 2022

@WoLewicki I think, I am not changing the stackPresentation from push to some other on an already active screen. i will investigate. thanks for you response.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Application tried to present modally an active controller"?
I have a UITabBarController which I create in the AppDelegate and give it the array of UIViewControllers . [tabBarController ...
Read more >
Tracking down a "Application tried… | Apple Developer Forums
The crashes are throwing an NSInvalidArgumentException with the message "Application tried to present modally an active controller <UIAlertController: ...
Read more >
ios bug :Application tried to present modally an active controller
I have a bug in my app and i can't to resolve it the bug shows this message: Application tried to present modally...
Read more >
App keeps crashing after an alert is presented, not sure what I ...
... app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller" but I ...
Read more >
Application tried to present modally an active controller ...
Your logic is a little bit strange to me, you are trying to dismiss imagePickerController and present the same view controller again.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found