Skip to content

Instantly share code, notes, and snippets.

@taisyo7333
Last active March 25, 2016 01:03
Show Gist options
  • Save taisyo7333/c66fdd3158d5589ee13d to your computer and use it in GitHub Desktop.
Save taisyo7333/c66fdd3158d5589ee13d to your computer and use it in GitHub Desktop.
react-native-orientation Lock to LandScapeによる例外発生
2016-03-25 08:54:38.640 [info][tid:com.facebook.React.JavaScript] Running application "landscape_test" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
2016-03-25 08:54:38.651 landscape_test[5155:66368] Locked to Landscape
2016-03-25 08:54:38.658 landscape_test[5155:66197] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [RCTModalHostViewController shouldAutorotate] is returning YES'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ef7ed85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010e176deb objc_exception_throw + 48
2 CoreFoundation 0x000000010ef7ecbd +[NSException raise:format:] + 205
3 UIKit 0x0000000110f45e36 -[UIViewController __supportedInterfaceOrientations] + 903
4 UIKit 0x0000000110f346c3 -[UIViewController _preferredInterfaceOrientationGivenStatusBarAndDeviceAndOrientation:] + 90
5 UIKit 0x0000000110e06c63 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 320
6 UIKit 0x00000001110e225c -[UIScreen _notifyOrientationWillChangeAndPropagateToAllWindows:] + 356
7 UIKit 0x00000001110df387 -[UIScreen _computeMetrics:] + 2088
8 UIKit 0x00000001110e047e -[UIScreen _setInterfaceOrientation:computeMetrics:animated:] + 94
9 UIKit 0x0000000110d90f8a -[UIApplication setStatusBarOrientation:animationParameters:notifySpringBoardAndFence:updateBlock:] + 793
10 UIKit 0x0000000110e09223 __78-[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:]_block_invoke1183 + 275
11 UIKit 0x00000001113b9fad __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke_2 + 161
12 UIKit 0x0000000110e4282b +[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:] + 188
13 UIKit 0x00000001113b9dd8 __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke + 134
14 UIKit 0x0000000110e3d838 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 582
15 UIKit 0x0000000110e3dc6d +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 105
16 UIKit 0x00000001113b9cc5 -[_UIWindowRotationAnimationController animateTransition:] + 535
17 UIKit 0x0000000110e05dfe -[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 656
18 UIKit 0x0000000110e08c54 -[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 2047
19 UIKit 0x0000000110e0974d -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 842
20 UIKit 0x0000000110e08280 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 184
21 UIKit 0x0000000110e06ed1 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 107
22 UIKit 0x0000000110e06d09 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 486
23 CoreFoundation 0x000000010ef48c8c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
24 CoreFoundation 0x000000010ef489cb _CFXRegistrationPost + 427
25 CoreFoundation 0x000000010ef48732 ___CFXNotificationPost_block_invoke + 50
26 CoreFoundation 0x000000010ef911e2 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1986
27 CoreFoundation 0x000000010ee40679 _CFXNotificationPost + 633
28 Foundation 0x000000010dd02cd9 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
29 UIKit 0x00000001110d730c -[UIDevice setOrientation:animated:] + 326
30 Foundation 0x000000010dd4119b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288
31 landscape_test 0x000000010da026cb __30-[Orientation lockToLandscape]_block_invoke + 155
32 Foundation 0x000000010dde9630 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
33 Foundation 0x000000010dd24805 -[NSBlockOperation main] + 101
34 Foundation 0x000000010dd07725 -[__NSOperationInternal _start:] + 646
35 Foundation 0x000000010dd07336 __NSOQSchedule_f + 194
36 libdispatch.dylib 0x0000000112a703eb _dispatch_client_callout + 8
37 libdispatch.dylib 0x0000000112a581ef _dispatch_main_queue_callback_4CF + 1738
38 CoreFoundation 0x000000010eed80f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
39 CoreFoundation 0x000000010ee99b99 __CFRunLoopRun + 2073
40 CoreFoundation 0x000000010ee990f8 CFRunLoopRunSpecific + 488
41 GraphicsServices 0x0000000113fecad2 GSEventRunModal + 161
42 UIKit 0x0000000110d8cf09 UIApplicationMain + 171
43 landscape_test 0x000000010da0171f main + 111
44 libdyld.dylib 0x0000000112aa492d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
2016-03-25 08:29:17.598 landscape_test[2432:37035] Locked to Landscape
2016-03-25 08:29:17.608 landscape_test[2432:36773] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [RCTModalHostViewController shouldAutorotate] is returning YES'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e445d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010d63ddeb objc_exception_throw + 48
2 CoreFoundation 0x000000010e445cbd +[NSException raise:format:] + 205
3 UIKit 0x000000011040ce36 -[UIViewController __supportedInterfaceOrientations] + 903
4 UIKit 0x00000001103fb6c3 -[UIViewController _preferredInterfaceOrientationGivenStatusBarAndDeviceAndOrientation:] + 90
5 UIKit 0x00000001102cdc63 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 320
6 UIKit 0x00000001105a925c -[UIScreen _notifyOrientationWillChangeAndPropagateToAllWindows:] + 356
7 UIKit 0x00000001105a6387 -[UIScreen _computeMetrics:] + 2088
8 UIKit 0x00000001105a747e -[UIScreen _setInterfaceOrientation:computeMetrics:animated:] + 94
9 UIKit 0x0000000110257f8a -[UIApplication setStatusBarOrientation:animationParameters:notifySpringBoardAndFence:updateBlock:] + 793
10 UIKit 0x00000001102d0223 __78-[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:]_block_invoke1183 + 275
11 UIKit 0x0000000110880fad __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke_2 + 161
12 UIKit 0x000000011030982b +[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:] + 188
13 UIKit 0x0000000110880dd8 __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke + 134
14 UIKit 0x0000000110304838 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 582
15 UIKit 0x0000000110304c6d +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 105
16 UIKit 0x0000000110880cc5 -[_UIWindowRotationAnimationController animateTransition:] + 535
17 UIKit 0x00000001102ccdfe -[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 656
18 UIKit 0x00000001102cfc54 -[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 2047
19 UIKit 0x00000001102d074d -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 842
20 UIKit 0x00000001102cf280 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 184
21 UIKit 0x00000001102cded1 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 107
22 UIKit 0x00000001102cdd09 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 486
23 CoreFoundation 0x000000010e40fc8c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
24 CoreFoundation 0x000000010e40f9cb _CFXRegistrationPost + 427
25 CoreFoundation 0x000000010e40f732 ___CFXNotificationPost_block_invoke + 50
26 CoreFoundation 0x000000010e4581e2 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1986
27 CoreFoundation 0x000000010e307679 _CFXNotificationPost + 633
28 Foundation 0x000000010d1c9cd9 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
29 UIKit 0x000000011059e30c -[UIDevice setOrientation:animated:] + 326
30 Foundation 0x000000010d20819b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288
31 landscape_test 0x000000010cec96cb __30-[Orientation lockToLandscape]_block_invoke + 155
32 Foundation 0x000000010d2b0630 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
33 Foundation 0x000000010d1eb805 -[NSBlockOperation main] + 101
34 Foundation 0x000000010d1ce725 -[__NSOperationInternal _start:] + 646
35 Foundation 0x000000010d1ce336 __NSOQSchedule_f + 194
36 libdispatch.dylib 0x0000000111f373eb _dispatch_client_callout + 8
37 libdispatch.dylib 0x0000000111f1f1ef _dispatch_main_queue_callback_4CF + 1738
38 CoreFoundation 0x000000010e39f0f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
39 CoreFoundation 0x000000010e360b99 __CFRunLoopRun + 2073
40 CoreFoundation 0x000000010e3600f8 CFRunLoopRunSpecific + 488
41 GraphicsServices 0x00000001134b3ad2 GSEventRunModal + 161
42 UIKit 0x0000000110253f09 UIApplicationMain + 171
43 landscape_test 0x000000010cec871f main + 111
44 libdyld.dylib 0x0000000111f6b92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
2016-03-25 08:51:39.063 [info][tid:com.facebook.React.JavaScript] Running application "landscape_test" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
2016-03-25 08:51:39.072 [info][tid:com.facebook.React.JavaScript] { getOrientation: [Function],
getSpecificOrientation: [Function],
lockToPortrait: [Function],
lockToLandscape: [Function],
lockToLandscapeRight: [Function],
lockToLandscapeLeft: [Function],
unlockAllOrientations: [Function],
addOrientationListener: [Function],
removeOrientationListener: [Function],
addSpecificOrientationListener: [Function],
removeSpecificOrientationListener: [Function],
getInitialOrientation: [Function] }, [Function]
2016-03-25 08:51:39.074 landscape_test[5046:63046] Locked to Landscape
2016-03-25 08:51:39.082 landscape_test[5046:63020] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [RCTModalHostViewController shouldAutorotate] is returning YES'
*** First throw call stack:
(
0 CoreFoundation 0x00000001037d8d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001029d0deb objc_exception_throw + 48
2 CoreFoundation 0x00000001037d8cbd +[NSException raise:format:] + 205
3 UIKit 0x000000010579fe36 -[UIViewController __supportedInterfaceOrientations] + 903
4 UIKit 0x000000010578e6c3 -[UIViewController _preferredInterfaceOrientationGivenStatusBarAndDeviceAndOrientation:] + 90
5 UIKit 0x0000000105660c63 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 320
6 UIKit 0x000000010593c25c -[UIScreen _notifyOrientationWillChangeAndPropagateToAllWindows:] + 356
7 UIKit 0x0000000105939387 -[UIScreen _computeMetrics:] + 2088
8 UIKit 0x000000010593a47e -[UIScreen _setInterfaceOrientation:computeMetrics:animated:] + 94
9 UIKit 0x00000001055eaf8a -[UIApplication setStatusBarOrientation:animationParameters:notifySpringBoardAndFence:updateBlock:] + 793
10 UIKit 0x0000000105663223 __78-[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:]_block_invoke1183 + 275
11 UIKit 0x0000000105c13fad __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke_2 + 161
12 UIKit 0x000000010569c82b +[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:] + 188
13 UIKit 0x0000000105c13dd8 __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke + 134
14 UIKit 0x0000000105697838 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 582
15 UIKit 0x0000000105697c6d +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 105
16 UIKit 0x0000000105c13cc5 -[_UIWindowRotationAnimationController animateTransition:] + 535
17 UIKit 0x000000010565fdfe -[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 656
18 UIKit 0x0000000105662c54 -[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 2047
19 UIKit 0x000000010566374d -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 842
20 UIKit 0x0000000105662280 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 184
21 UIKit 0x0000000105660ed1 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 107
22 UIKit 0x0000000105660d09 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 486
23 CoreFoundation 0x00000001037a2c8c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
24 CoreFoundation 0x00000001037a29cb _CFXRegistrationPost + 427
25 CoreFoundation 0x00000001037a2732 ___CFXNotificationPost_block_invoke + 50
26 CoreFoundation 0x00000001037eb1e2 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1986
27 CoreFoundation 0x000000010369a679 _CFXNotificationPost + 633
28 Foundation 0x000000010255ccd9 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
29 UIKit 0x000000010593130c -[UIDevice setOrientation:animated:] + 326
30 Foundation 0x000000010259b19b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288
31 landscape_test 0x000000010225c6cb __30-[Orientation lockToLandscape]_block_invoke + 155
32 Foundation 0x0000000102643630 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
33 Foundation 0x000000010257e805 -[NSBlockOperation main] + 101
34 Foundation 0x0000000102561725 -[__NSOperationInternal _start:] + 646
35 Foundation 0x0000000102561336 __NSOQSchedule_f + 194
36 libdispatch.dylib 0x00000001072ca3eb _dispatch_client_callout + 8
37 libdispatch.dylib 0x00000001072b21ef _dispatch_main_queue_callback_4CF + 1738
38 CoreFoundation 0x00000001037320f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
39 CoreFoundation 0x00000001036f3b99 __CFRunLoopRun + 2073
40 CoreFoundation 0x00000001036f30f8 CFRunLoopRunSpecific + 488
41 GraphicsServices 0x0000000108846ad2 GSEventRunModal + 161
42 UIKit 0x00000001055e6f09 UIApplicationMain + 171
43 landscape_test 0x000000010225b71f main + 111
44 libdyld.dylib 0x00000001072fe92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
/**
* Sample React Native App
* https://github.com/facebook/react-native
* react-native 0.22
*/
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View
} from 'react-native';
var Orientation = require('react-native-orientation');
class landscape_test extends Component {
constructor(props) {
super(props);
Orientation.lockToLandscape(); // throw exception
}
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('landscape_test', () => landscape_test);
@taisyo7333
Copy link
Author

XCode
Version 7.3 (7D175)

@taisyo7333
Copy link
Author

./node_modules/react-native/React/Views/RCTModalHostViewController.m:27:- (UIInterfaceOrientationMask)supportedInterfaceOrientations

  • (UIInterfaceOrientationMask)supportedInterfaceOrientations
    {
    // // Picking some defaults here, we should probably make this configurable
    // if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
    // return UIInterfaceOrientationMaskAll;
    // } else {
    // return UIInterfaceOrientationMaskPortrait;
    // }
    return UIInterfaceOrientationMaskAll;
    }
    これで直ったが・・・。

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