question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android + react-native-screens + createNativeStackNavigator not keeping orientation on SDK 41.

See original GitHub issue

Summary

After upgrading to SDK 41, I started noticing that my portrait app went landscape only on Android devices (I tested it on two android devices).

I looked for the bug and it’s due to an issue in the react-native-screens library that I believe is a regression:

https://github.com/software-mansion/react-native-screens/issues/836

I’ve tried all the fixes the others have tried in the ticket, but NOTHING worked for me. Maybe I missed something or maybe something special needs to be done for Expo Managed apps?

I made an MCVE so you guys can see what’s happening. For some reason this wasn’t happening on SDK 40.

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?

Android

SDK Version (managed workflow only)

41

Environment

Expo CLI 4.4.4 environment info: System: OS: macOS 11.1 Shell: 3.2.57 - /bin/bash Binaries: Node: 14.12.0 - /usr/local/bin/node Yarn: 1.22.5 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/bin/npm Managers: CocoaPods: 1.10.1 - /Users/aryk/.rvm/gems/ruby-2.6.0/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 IDEs: Android Studio: 4.0 AI-193.6911.18.40.6514223 Xcode: 12.5/12E262 - /usr/bin/xcodebuild npmPackages: expo: ^41.0.0 => 41.0.1 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz => 0.63.2 npmGlobalPackages: expo-cli: 4.4.4 Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

https://github.com/Aryk/expo-repro/tree/android-orientation

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brentvatnecommented, May 14, 2021

fork is fine too. but patch-package is easier imo

0reactions
Arykcommented, May 13, 2021

Great, I’ll give this a shot. As far as making the change.

Is it enough if I just fork the package, make the one line change and then build with EAS, right?

@cruzach mentioned something about using patch-package, but I’m hoping just a straightforward fork and pointing my package.json to the right sha like https://github.com/Aryk/react-native-screens.git#54e852095b is enough.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-screens/native-stack BUG ORIENTATION #836
i use createNativeStackNavigator from 'react-native-screens/native-stack'; i have one problem in two cases: first is when i fixed orientation: dont work.
Read more >
react native - Android screen orientation even ... - Stack Overflow
The issue was in the router file(Navigation setup). I was using the createNativeStackNavigator from react-native-screens/native-stack instead of ...
Read more >
Native Stack Navigator | React Navigation
Native Stack Navigator provides a way for your app to transition between screens where each new screen is placed on top of a...
Read more >
Expo SDK 41. Today we're announcing the release of…
The new version of react-native-screens (v3) “enables screens” by default. If you encounter any related issues, you can report the issue and opt ......
Read more >
A react-native module that can listen on orientation changing ...
RN 0.58 + Android target SDK 27 maybe cause Issue: java.lang. ... Linking is not required in React Native 0.60 and above.
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 Reddit Thread

No results found

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