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.

[expo-dev-client] [status bar] [android] Statusbar is fully transparent instead of translucent

See original GitHub issue

Summary

On Android, when using expo-dev-client and starting the packager via expo start --dev-client the status bar is fully transparent instead of being translucent. The test project was created via CRNA, no native changes were made.

Expected Actual
image image

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

bare

What platform(s) does this occur on?

Android

Package versions

"expo": "~42.0.0",
"expo-dev-client": "^0.4.3",
"expo-status-bar": "~1.0.4",
"react": "16.13.1",
"react-native": "~0.63.4",
"expo-splash-screen": "~0.11.2",
"react-native-unimodules": "~0.14.3"

Environment

Expo CLI 4.7.3 environment info: System: OS: macOS 11.4 Shell: 5.8 - /bin/zsh Binaries: Node: 16.4.2 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 7.18.1 - /usr/local/bin/npm Watchman: 2021.06.07.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /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: 23, 24, 29, 30 Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0, 31.0.0, 31.0.0, 31.0.0 System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom IDEs: Android Studio: 4.2 AI-202.7660.26.42.7486908 Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild npmPackages: expo: ~42.0.0 => 42.0.0 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: ~0.63.4 => 0.63.4 react-native-web: ~0.13.12 => 0.13.18 npmGlobalPackages: expo-cli: 4.7.3 Expo Workflow: bare

Reproducible demo or steps to reproduce from a blank project

  • npx crna -t with-dev-client
  • use the following code in App.js:
import React from "react";
import { StyleSheet, Text, View } from "react-native";

export default function App() {
  return (
    <View style={styles.container}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
    alignItems: "center",
    justifyContent: "center",
  },
});

Test 1:

  • run expo start --dev-client
  • open app and check status bar

❌ NOK: Statusbar is fully invisible instead of having a grey background.

Test 2:

  • completely close the previous app instance (refresh does not work)
  • run yarn react-native start
  • open app and check status bar

✅ OK: Statusbar is translucent.

Stacktrace (if a crash is involved)

No response

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Yonomcommented, Sep 11, 2021

I updated the global eas and expo installations and got a transparent status bar instead of a translucent one as well.

I am not sure when or if the defaults changed, but I had to set the following to make the status bar translucent as I expected it to be:

    "androidStatusBar": {
      "barStyle": "light-content",
    },

This behavior is consistent on dev and release modes and actually documented here https://docs.expo.dev/versions/latest/config/app/#barstyle, so I will close this issue now!

0reactions
lukmccallcommented, Sep 10, 2021

Hmm, that’s weird. I tested your app on the Pixel 3 emulator. In my case, the status bar is always transparent. image

I’m guessing that it should be `translucent either way but, weirdly, the behavior is the same no matter what I do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Completely transparent Status Bar? - Stack Overflow
I used the code and then added an image as background and then added android:fitsSystemWindows="true" to my activity_main.xml. The system bars are translucent...
Read more >
Android: Full Screen UI with Transparent Status Bar
This article talks about how to make the status bar transparent in any Android app. Also, it deals with how to make a...
Read more >
Translucent splash status bar works in managed app but not ...
In a managed app, the status bar on Android is translucent while the splash ... it's also necessary but I set the statusBarColor...
Read more >
Configuring the status bar - Expo Documentation
Defaults to true . A translucent status bar makes sense when the backgroundColor is using a transparent color ( #RRGGBBAA ).
Read more >
Translucent SystemBars the right way — across API levels ...
Enables the navigation bar buttons to be dark. Solution. Note: We will be using a transparent statusBarColor. Because we will instead use AppBar ......
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