[expo-screen-orientation] Screen orientation does not lock or trigger with EAS Build
See original GitHub issueSummary
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
- Create a build with EAS Build for iOS
- Call the function https://docs.expo.dev/versions/latest/sdk/screen-orientation/#screenorientationlockasyncorientationlock
- Foregrounding/backgrounding the app and calling the function again does not trigger the screen to lock orientation.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:24
- Comments:59 (2 by maintainers)
Top Related StackOverflow Question
Experiencing the same issue. Used to work before transitioning to eas build, but now calling
ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.LANDSCAPE_RIGHT)does nothing.also using EAS and experiencing this behavior.
i can call
ScreenOrientation.unlockAsync()and thenScreenOrientation.getPlatformOrientationLockAsync()will returnhowever, 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 thegetPlatformOrientationLockAsync, it does seem to think it’s overriding it.edit: also did set
expo.ios.requireFullScreen = trueas the expo-screen-orientation docs say to do.