Skip to content

Modai from "react-native" crashes the App in iOS. Works fine in android #44751

@naheedsa

Description

@naheedsa

Description

We are facing a crash in the Modal imported from react-native

Steps to reproduce

  1. npx react-native run-ios
  2. App builds successfully
  3. Opens a Modal, crashes

React Native Version

0.72.14

Affected Platforms

Runtime - iOS

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: macOS 14.4.1
  CPU: (8) arm64 Apple M1
  Memory: 444.64 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 16.16.0
    path: ~/.nvm/versions/node/v16.16.0/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.nvm/versions/node/v16.16.0/bin/yarn
  npm:
    version: 8.19.2
    path: ~/.nvm/versions/node/v16.16.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.14.3
    path: /Users/jasem/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 3.2.2
    path: /Users/jasem/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 11.3.8
    wanted: 11.3.8
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.72.14
    wanted: 0.72.14
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: true
  newArchEnabled: true

info React Native v0.74.1 is now available (your project is running on v0.72.14).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.74.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.72.14
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos&platform=android".

Stacktrace or Logs

Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [RCTFabricModalHostViewController shouldAutorotate] is returning YES'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001804ae138 __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x0000000180087db4 objc_exception_throw + 56
	2   CoreFoundation                      0x00000001804ae048 -[NSException initWithCoder:] + 0
	3   UIKitCore                           0x0000000184cc53c8 -[UIViewController __supportedInterfaceOrientations] + 804
	4   UIKitCore                           0x0000000184bd0a00 -[_UIFullscreenPresentationController _prepareForMixedOrientationTransitionIfNecessaryInWindow:fromViewController:toViewController:] + 444
	5   UIKitCore                           0x0000000184bd0760 -[_UIFullscreenPresentationController _adjustOrientationIfNecessaryInWindow:forViewController:preservingViewController:] + 868
	6   UIKitCore                           0x0000000184bc781c -[UIPresentationController _presentWithAnimationController:inWindow:interactionController:target:didFinish:] + 520
	7   UIKitCore                           0x0000000184cbc9c8 -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1152
	8   UIKitCore                           0x0000000184cbf080 -[UIViewController _presentViewController:withAnimationController:completion:] + 3312
	9   UIKitCore                           0x0000000184cbfb74 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 84
	10  UIKitCore                           0x0000000184cbfe24 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 452
	11  UIKitCore                           0x0000000184cbfae4 -[UIViewController _presentViewController:animated:completion:] + 160
	12  UIKitCore                           0x0000000184cbfec8 -[UIViewController presentViewController:animated:completion:] + 140
	13  stellarmate                         0x000000010047851c -[RCTModalHostViewComponentView presentViewController:animated:completion:] + 88
	14  stellarmate                         0x0000000100478638 -[RCTModalHostViewComponentView ensurePresentedOnlyIfNeeded] + 188
	15  stellarmate                         0x00000001004789cc -[RCTModalHostViewComponentView didMoveToWindow] + 56
	16  UIKitCore                           0x00000001859030c4 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1712
	17  UIKitCore                           0x0000000185902cbc -[UIView(Internal) _didMoveFromWindow:toWindow:] + 680
	18  UIKitCore                           0x0000000185902cbc -[UIView(Internal) _didMoveFromWindow:toWindow:] + 680
	19  UIKitCore                           0x0000000185902cbc -[UIView(Internal) _didMoveFromWindow:toWindow:] + 680
	20  UIKitCore                           0x000000018588a8d0 -[UIScrollView _didMoveFromWindow:toWindow:] + 84
	21  UIKitCore                           0x0000000185902cbc -[UIView(Internal) _didMoveFromWindow:toWindow:] + 680
	22  UIKitCore                           0x00000001858f854c __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 120
	23  UIKitCore                           0x00000001858f8464 -[UIView _postMovedFromSuperview:] + 428
	24  UIKitCore                           0x000000018590516c -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2212
	25  stellarmate                         0x00000001004a95b8 -[RCTViewComponentView mountChildComponentView:index:] + 96
	26  stellarmate                         0x000000010047ccd0 _ZNSt3__110__function6__funcIZ41-[RCTMountingManager performTransaction:]E3$_1NS_9allocatorIS2_EEFvRKN8facebook5react19MountingTransactionERKNS6_16SurfaceTelemetryEEEclES9_SC_ + 500
	27  stellarmate                         0x000000010041f05c _ZNK8facebook5react19TelemetryController15pullTransactionERKNSt3__18functionIFvRKNS0_19MountingTransactionERKNS0_16SurfaceTelemetryEEEESD_SD_ + 368
	28  stellarmate                         0x000000010047bec0 -[RCTMountingManager performTransaction:] + 144
	29  stellarmate                         0x000000010047be14 -[RCTMountingManager initiateTransaction:] + 64
	30  libdispatch.dylib                   0x0000000180170104 _dispatch_call_block_and_release + 24
	31  libdispatch.dylib                   0x0000000180171978 _dispatch_client_callout + 16
	32  libdispatch.dylib                   0x00000001801807c8 _dispatch_main_queue_drain + 1276
	33  libdispatch.dylib                   0x00000001801802bc _dispatch_main_queue_callback_4CF + 40
	34  CoreFoundation                      0x000000018040e9a0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
	35  CoreFoundation                      0x00000001804090b8 __CFRunLoopRun + 1936
	36  CoreFoundation                      0x0000000180408514 CFRunLoopRunSpecific + 572
	37  GraphicsServices                    0x000000018ef06ae4 GSEventRunModal + 160
	38  UIKitCore                           0x00000001853e8040 -[UIApplication _run] + 868
	39  UIKitCore                           0x00000001853ebcc8 UIApplicationMain + 124
	40  stellarmate                         0x0000000100101110 main + 80
	41  dyld                                0x0000000101ff1544 start_sim + 20
	42  ???                                 0x00000001020ce0e0 0x0 + 4329365728
	43  ???                                 0x636b000000000000 0x0 + 7163819632262905856
)
libc++abi: terminating due to uncaught exception of type NSException

Reproducer

#44277

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions