react-native-orientation
react-native-orientation copied to clipboard
ios Orientation.lockToLandscape() Error
*** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [RCCTabBarController shouldAutorotate] is returning YES' *** First throw call stack: What problem? please help me
Same issue here.
Can you allow both portrait and landscape but still lock it on only one of them ?
I'm having the same issue. Did anyone find a solution?
Hey @andyesp, my workaround was create a timeout before lockToLandscape, Something like this
setTimeout(function(){ Orientation.lockToLandscape(); }, 100)
I am using a component with webview and setTimeout did not solve =/
Got the same error.
There is my analysis (I know nothing on iOS native development, so this is mainly trial/error, code reading and logic) :
- You request to lock to landscape so
supportedInterfaceOrientationsForWindow
returns now 'Landscape'. - You're phone is still in Portrait position. Portrait is not Landscape :
Supported orientations has no common orientation with the application
- Some controller somewhere says : You should be able to autorotate.
[RCCTabBarController shouldAutorotate] is returning YES
- iOS catches the incoherence and crashes.
As a workaround, I edit my controller.
- Import "Orientation.h"
- Changes
return YES
byreturn [Orientation getOrientation] == UIInterfaceOrientationMaskAllButUpsideDown
Dirty but it works.
+1
I got this error while using a Modal
and the solution at https://github.com/yamill/react-native-orientation/issues/246#issuecomment-347427696 fixed it for me.
I got this error while using a
Modal
and the solution at #246 (comment) fixed it for me.
Thanks. Error with modal for me.
the issue still unresolved for 4 Years :))
yes, I am facing the same issue. Can anyone help me to resolve this?
I have updated all of my Modals like below:
<Modal
visible={true}
supportedOrientations={['portrait', 'landscape']}
>
</Modal>
please, any help?