java.lang.RuntimeException: Expo encountered a fatal error: TypeError: undefined is not an object (evaluating 's.default.Orientation')

My app is crashing on random android devices with below stack trace reported in google play store:

java.lang.RuntimeException: Expo encountered a fatal error: TypeError: undefined is not an object (evaluating ‘s.default.Orientation’), stack:
v 2:1473
v 2:1473
v 2:1473
v 2:1473
d 2:875
global code 1278:3

at host.exp.exponent.experience.q.E(
at host.exp.exponent.experience.-$$Lambda$BaseExperienceActivity$ (
at android.os.Handler.handleCallback (
at android.os.Handler.dispatchMessage (
at android.os.Looper.loop (
at (
at java.lang.reflect.Method.invoke (Native Method)
at$ (
at (

There is no indication where the issue is. Can someone help to interpret above error to find root cause of the crash?

I am using:

  1. SDK Version: 41
  2. Platforms(Android/iOS/web/all): Android
  3. Error is reported on real device having different Android SDK version and different brand/models

you didn’t share any code so it’s hard to say. but maybe you are not importing screenorientation correctly:

import * as ScreenOrientation from 'expo-screen-orientation';
// ^ this is correct

you might be doing

import ScreenOrientation from 'expo-screen-orientation';
// ^ this is wrong

see docs: ScreenOrientation - Expo Documentation

1 Like

@notbrent Thanks for reply. I did not share the code because I do not know which code is causing the crash. Let me know which code can help find the root cause. I will share it here.

Also, I did not find any references to expo-screen-orientation or ScreenOrientation in my whole project.

Also, note that my app does not support orientation change. Means, it supports only portrait mode. We have mentioned "orientation": "portrait" in app.json.

here is how you can find the root cause: fyi/ at master · expo/fyi · GitHub

@notbrent Thanks for reply. What I mean by finding the root cause is the line of code in .js file causing the issue same way Java/C# stack trace tells the exact file name and line number causing the exception.

Is there a way to relate .js file (with line number) just by looking at crash report provided from play store?

if it’s caused by javascript then you could possibly use a service like sentry

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.