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

IOS Application tried to present modal view controller on itself. Presenting controller is <RCTModalHostViewController: 0x1576fa2b0> #32366

Closed
harleenarora opened this issue Oct 9, 2021 · 10 comments
Labels
Component: Modal Needs: Attention Issues where the author has responded to feedback. Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@harleenarora
Copy link

App crash on IOS devices on click modal. After update the react-native 0.66.0 version.

Platforms

Crash on IOS platform

Versions

  • react-native-modal:13.0.0
  • react-native:0.66.0
  • react:17.0.2

Description

Fatal Exception: NSInvalidArgumentException 0 CoreFoundation 0x11b928 __exceptionPreprocess 1 libobjc.A.dylib 0x26480 objc_exception_throw 2 UIKitCore 0x47cd4c -[UIViewController popoverPresentationController:] 3 UIKitCore 0x47d7c0 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke_2 4 UIKitCore 0x102329c +[UIView(Animation) performWithoutAnimation:] 5 UIKitCore 0x47d720 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke 6 UIKitCore 0x496754 -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] 7 UIKitCore 0x492ff0 -[_UIViewControllerTransitionContext _runAlongsideCompletions] 8 UIKitCore 0x492d1c -[_UIViewControllerTransitionContext completeTransition:] 9 UIKitCore 0xfcfee4 -[_UIAfterCACommitBlock run] 10 UIKitCore 0xb3f9c4 _runAfterCACommitDeferredBlocks 11 UIKitCore 0xb2ee90 _cleanUpAfterCAFlushAndRunDeferredBlocks 12 UIKitCore 0xb601e0 _afterCACommitHandler 13 CoreFoundation 0x99c40 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ 14 CoreFoundation 0x94270 __CFRunLoopDoObservers 15 CoreFoundation 0x9480c __CFRunLoopRun 16 CoreFoundation 0x93ed0 CFRunLoopRunSpecific 17 GraphicsServices 0x3570 GSEventRunModal 18 UIKitCore 0xb302d0 -[UIApplication _run] 19 UIKitCore 0xb3584c UIApplicationMain 21 libdyld.dylib 0x1140 start

@react-native-bot react-native-bot added Component: Modal Platform: iOS iOS applications. Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. and removed Needs: Triage 🔍 labels Oct 9, 2021
@github-actions
Copy link

github-actions bot commented Oct 9, 2021

⚠️ Missing Environment Information
ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

@harleenarora
Copy link
Author

(node:16503) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
System:
OS: Linux 5.11 Ubuntu 20.04.3 LTS (Focal Fossa)
CPU: (4) x64 Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz
Memory: 161.41 MB / 15.51 GB
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 14.17.6 - /usr/bin/node
Yarn: Not Found
npm: 6.14.15 - /usr/bin/npm
Watchman: Not Found
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: AI-203.7717.56.2031.7678000
Languages:
Java: 11.0.11 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.0 => 0.66.0
npmGlobalPackages:
react-native: Not Found

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Oct 9, 2021
@N3TC4T
Copy link

N3TC4T commented Oct 31, 2021

same here

Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: 'Application tried to present modal view controller on itself. Presenting controller is <RCTModalHostViewController: 0x7f7f9f1815a0>.'
CoreSimulator 776.3
Runtime: iOS 15.0 (19A339)
DeviceType: iPhone 12 Pro Max

@harleenarora can I ask what navigation library you are using ?

@randomBrainstormer
Copy link

+1, also after updating to RN 0.66. I'm using wix/react-native-navigation library

@DioneJM
Copy link

DioneJM commented Nov 9, 2021

I was experiencing the same thing when trying to close a modal 100% of the time.
I believe it may be due to these dependencies since once I yarn remove'd them, interacting with the modal behave as expected:

"@gorhom/bottom-sheet": "^4",
"react-native-gesture-handler": "^1.10.3",
"react-native-reanimated": "^2.3.0-beta.3"

My react-native info:

System:
    OS: macOS 12.0
    CPU: (10) x64 Apple M1 Max
    Memory: 6.73 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.0/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
    Watchman: 2021.06.07.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
  Languages:
    Java: 15.0.2 - /usr/local/opt/openjdk/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.66.1 => 0.66.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

And I am also using wix/react-native-navigation for my project

@Mlobaievskyi
Copy link

I resolved this issue by downgrading react-native-reanimated "^2.3.0-beta.3" -> "^2.2.4"

@saducandy
Copy link

@Mlobaievskyi Thank You so much , It works !

@chris-cornell
Copy link

@randomBrainstormer did you ever find a solution? i'm using wix/react-native-navigation but not react-native-reanimated (which seems to be the problem for everyone else here)

@randomBrainstormer
Copy link

@chris-cornell my issue was fixed by downgrading react-native-reanimated to ^2.2.4. Currently I'm using wix/react-native-navigation version ^7.23.1 and so far I've seen this issue only when upgrading react-native-reanimated to its latest version.

Evidently something is breaking modal presentation in certain conditions, coming either from react-native or wix's react-native-navigation.

yogevbd added a commit to wix/react-native-navigation that referenced this issue Jan 18, 2022
…dals (#7423)

In some specific (and hard to reproduce) cases, RN modal presentation block tries to present a modal that is already presented in the hierarchy which caused that crash.

Addresses facebook/react-native#32366
yogevbd added a commit to wix/react-native-navigation that referenced this issue Jan 18, 2022
…dals (#7423)

In some specific (and hard to reproduce) cases, RN modal presentation block tries to present a modal that is already presented in the hierarchy which caused that crash.

Addresses facebook/react-native#32366
yogevbd added a commit to wix/react-native-navigation that referenced this issue Jan 18, 2022
…dals (#7423)

In some specific (and hard to reproduce) cases, RN modal presentation block tries to present a modal that is already presented in the hierarchy which caused that crash.

Addresses facebook/react-native#32366
@github-actions
Copy link

github-actions bot commented Jul 9, 2022

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 9, 2022
@facebook facebook locked as resolved and limited conversation to collaborators Jul 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: Modal Needs: Attention Issues where the author has responded to feedback. Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

9 participants