Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 28463

Uncaught Error: Invariant Violation & Screen Orientation

$
0
0

I'm somewhat new to React / React Native and after updating a project from a previous version of Expo, I keep running into odd "uncaught errors" with what seems to be Expo's Screen Orientation that holds the app back from loading.

Based on Expo's documentation (listed below), I've attempted to rewrite how the app is enforcing a specific screen orientation on load, but I keep running into errors.

https://docs.expo.io/versions/latest/sdk/screen-orientation/#screenorientationallowasyncorientationlock

ScreenOrientation.lockAsync(ScreenOrientation.Orientation.LANDSCAPE);
    if (!this.state.isReady) {
      return <Expo.AppLoading />;
    }

ScreenOrientation.lockAsync(ScreenOrientation.Orientation.LANDSCAPE_LEFT);
    return (

Originally, the application loaded in landscape and locked, but now the app is getting held up on a "invariant violation" error. To view a screenshot of the error that's being produced, please check out the link below.

https://imgur.com/a/Uw4fnCI


Viewing all articles
Browse latest Browse all 28463

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>