Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.58.2] StatusBar Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' on a null object reference #23193

Closed
abendi opened this issue Jan 28, 2019 · 3 comments
Labels
Bug Component: StatusBar Resolution: Locked This issue was locked by the bot.

Comments

@abendi
Copy link

abendi commented Jan 28, 2019

EDIT: Seems to be fixed in 0.58.3.

Environment

 React Native Environment Info:
    System:
      OS: Windows 10
      CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
      Memory: 699.78 MB / 7.83 GB
    Binaries:
      Yarn: 1.10.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version  3.2.0.0 AI-181.5540.7.32.5056338

Description

After upgrading from 0.58.1 to 0.58.2, using StatusBar's declarative API now throws an exception on Android (haven't tested on IOS).

render() {
  return (
    <View>
      <StatusBar barStyle={"dark-content"} animated={true} />
    </View>
  );
}

I fiddled around with props and after adding backgroundColor={"transparent"} hidden={false} it stopped throwing the exception.

Using imperative API instead of declarative, e.g. StatusBar.setBarStyle("dark-content", true); seems to be working fine.

Not sure if it's a bug or breaking change, but after adding those props, status bar now seems to overwrite previously set translucent={true} to false and needs to be explicitly set again.

Reproducible Demo

See description.

@abendi
Copy link
Author

abendi commented Jan 28, 2019

Seems to have been fixed in freshly released 0.58.3. 🥇

@erickriva
Copy link

erickriva commented May 20, 2019

I was using StatusBar like this on my render():

<StatusBar
    barStyle="dark-content"
    backgroundColor={this.state.item.color} />

but backgroundColor value was a empty string at first render() execution, so the exception was thrown.
When testing, i've put a valid string color and everything's working fine now.

@andreifilip123
Copy link

I still encounter this issue in 0.59.8 @abendi. I also tried the solution provided here but with no results.

@facebook facebook locked as resolved and limited conversation to collaborators Jan 29, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: StatusBar Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants