[expo-screen-orientation] Screen orientation does not lock or trigger with EAS Build

See original GitHub issue

Summary

On a built app with EAS build, calling https://docs.expo.dev/versions/latest/sdk/screen-orientation/#screenorientationlockasyncorientationlock does not trigger the screen to rotate and lock on iOS. When the app isn’t built with EAS build, and created with expo build, the screen orientation lock async function works.

Could possibly be related to: https://github.com/expo/expo/issues/11558

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

43

Environment

Expo CLI 4.12.10 environment info: System: OS: macOS 11.6 Shell: 5.8 - /bin/zsh Binaries: Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node Yarn: 3.0.2 - ~/.nvm/versions/node/v14.15.1/bin/yarn npm: 6.14.8 - ~/.nvm/versions/node/v14.15.1/bin/npm Watchman: 2021.06.07.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 Android SDK: API Levels: 30, 31 Build Tools: 29.0.2, 30.0.2, 31.0.0 System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-31 | Android TV Intel x86 Atom, android-31 | ARM 64 v8a, android-31 | Intel x86 Atom_64, android-31 | Google TV Intel x86 Atom, android-31 | Google APIs ARM 64 v8a, android-31 | Google APIs Intel x86 Atom_64, android-31 | Google Play ARM 64 v8a, android-31 | Google Play Intel x86 Atom_64 IDEs: Android Studio: 4.1 AI-201.8743.12.41.6953283 Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild npmPackages: expo: ^43.0.0 => 43.0.1 react: 17.0.1 => 17.0.1 react-dom: 17.0.1 => 17.0.1 react-native: 0.64.2 => 0.64.2 react-native-web: 0.17.1 => 0.17.1 npmGlobalPackages: expo-cli: 4.12.10 Expo Workflow: bare

Reproducible demo or steps to reproduce from a blank project

  1. Create a build with EAS Build for iOS
  2. Call the function https://docs.expo.dev/versions/latest/sdk/screen-orientation/#screenorientationlockasyncorientationlock
  3. Foregrounding/backgrounding the app and calling the function again does not trigger the screen to lock orientation.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:24
  • Comments:59 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
silberistgoldcommented, Dec 13, 2021

Experiencing the same issue. Used to work before transitioning to eas build, but now calling ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.LANDSCAPE_RIGHT) does nothing.

8reactions
ironforwardcommented, Nov 22, 2021

also using EAS and experiencing this behavior.

i can call ScreenOrientation.unlockAsync() and then ScreenOrientation.getPlatformOrientationLockAsync() will return

{
  screenOrientationArrayIOS: [
    1, // Orientation.PORTRAIT_UP
    3, // Orientation.LANDSCAPE_LEFT
    4, // Orientation.LANDSCAPE_RIGHT
  ]
}

however, the screen will not rotate when tilting the phone – made sure portrait lock was turned off on the phone too.

calling ScreenOrientation.lockAsync(OrientationLock.LANDSCAPE_RIGHT) does not have any effect either, but no errors are thrown.

app.json does have "orientation": "portrait"; however, the expo-screen-orientation docs say it will override this and, at least from what it’s returning in the getPlatformOrientationLockAsync, it does seem to think it’s overriding it.

edit: also did set expo.ios.requireFullScreen = true as the expo-screen-orientation docs say to do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ScreenOrientation - Expo Documentation
You can configure expo-screen-orientation using its built-in config plugin if you use config ... The platform does not support the orientation lock policy....
Read more >
Expo-Screen-Orientation doesn't work with EAS BUILD - Reddit
I am using Expo-screen-orientation, managed flow and eas build. When I rotate in landscape it doesn't work after doing eas build in ios ......
Read more >
React Native, expo-screen-orientation - Stack Overflow
By default my app use portrait mode, but sometimes I need change screen orientation to landscape mode. I use expo-screen-orientation library ...
Read more >
Expo Upgrade To Sdk 38, _Expo.Screenorientation ... - ADocLib
You can now try a preview of EAS Build the new build service from Expo. ... will help you to resolve your problem...
Read more >
Newest 'screen-orientation' Questions - Stack Overflow
I have been having problems with React Native screen rotation. The rotation is locked to portrait mode and I would like to enable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found