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.

Portrait screen orientation is not locked properly on Android 8.1

See original GitHub issue

Environment

  React Native Environment Info:
    System:
      OS: macOS 10.14.2
      CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
      Memory: 393.55 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.12.0 - /usr/local/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 23, 25, 26, 27, 28
        Build Tools: 26.0.2, 26.0.3, 27.0.3, 28.0.2
        System Images: android-24 | Google Play Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: 0.57.8 => 0.57.8 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Description

Preconditions:

  1. You must have android device with 27 API
  2. I created new App via react-native init appName
  3. Added this option in my AndroidManifest.xml to .MainActivity android:screenOrientation="portrait"
  4. Added button with some deeplink Linking.openURL('https://www.google.com/maps/dir/api=1&travelmode=driving&origin=10,11&destination=12,11');

Steps:

  1. Rotate phone in landscape
  2. Open a new app with deeplink
  3. Go back to your app

Actual result: 3 rotations before we will see proper portrait screen orientation. Expected result: one rotation directly in portrait screen orientation without others.

Repo with this bug: https://github.com/andrej-kuznetsov/screenRotationRNBug

Reproducible Demo

Follow above instructions or this video: https://drive.google.com/open?id=1Y989iGoFLu4PZUcKvuBSiS4Wiwv_At1p

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
Titozzzcommented, Mar 19, 2019

I’ve followed the exacts same step as the video and the bug doesn’t occur on my side so we’ll close this issue.

Tested on android 8.0, with your repro folder. If you manage to submit another repro that would be broken on both side, we’ll be happy to open this again.

0reactions
eXist-FraGGercommented, Apr 1, 2019

I’ve followed the exacts same step as the video and the bug doesn’t occur on my side so we’ll close this issue.

Tested on android 8.0, with your repro folder. If you manage to submit another repro that would be broken on both side, we’ll be happy to open this again.

In the title of this issue - “… on Android 8.1”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android 8.1 screen orientation issue: flipping to landscape ...
I found that on Android 8.1 every time I open the video activity and close it the previous activity go to landscape even...
Read more >
Android 8.1 screen rotation [69168442] - Issue Tracker - Google
What you think the correct behavior should be. - The portrait activity should stay portrait and don't flip every time when I finish...
Read more >
Screen Orientation Quick Flip - Bugs
But if holding in landscape position & screen orientation is set to portrait, flipping behaviour of next screen is observed as you mentioned....
Read more >
Lock Screen to Portrait or Landscape With Lock Button on ...
See how you can lock the screen to portrait or landscape mode using the lock button on Android smartphone. Android Pie 9.
Read more >
MDM Android Enterprise Screen orinetation lock on device ...
Hi Team, We have a issue with setting Android device screen orientation in MDM to stay in portrait mode regardless of the way...
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