thebylito / react-native-navigation-bar-color

React Native component to change bottom bar/navigation bar color on Android
MIT License
269 stars 49 forks source link

App crashing #23

Open usmanfaisal60 opened 4 years ago

usmanfaisal60 commented 4 years ago

I am following the same steps but my app keeps crashing. Android 9.0 react-native-cli: 2.0.1 react-native: 0.61.1 Any help will be appreciated

thebylito commented 4 years ago

Can you show your crash logs?

theolavaux commented 4 years ago

Seems to be an Android 9.0 problem, I got the same :( The apps logs undefined when catching the error and then crashes.

thebylito commented 4 years ago

can you test in latest release?

theolavaux commented 4 years ago

I just did, and its still crashing in version 1.0

thebylito commented 4 years ago

Ok, I will try to test on a device with Android 9, and warning as soon as there is news. Thanks.

matheusbaumgart commented 4 years ago

Any updates?

thebylito commented 4 years ago

Hi, I tested it today with Android API 29 (Q) and I didn't have any errors. Can you get me a repository where the problem occurs?

crutchcorn commented 4 years ago

I'm able to recreate this behavior on an Android 10 device @thebylito. A demo repo can be found at this branch:

https://github.com/crutchcorn/GitShark/tree/crashing_nav_bar

crutchcorn commented 4 years ago

It seems that @coin3x might have figured out the reason for the crashing in specific instances:

https://github.com/crutchcorn/GitShark/issues/6#issuecomment-613437549

bjornarhagen commented 3 years ago

Crashing for me on Android 10 (Essential PH-1) and Android 8.1 (Pixel 3 emulator). TypeError: null is not an object (evaluating 'NavigationBarColor.changeNavigationBarColor')

Usage:

import React from "react";
import { Text } from "react-native";
import changeNavigationBarColor from "react-native-navigation-bar-color";

export function App() {
  changeNavigationBarColor("blue", true, true);

  return <Text>Hello world</Text>;
}

Dependencies in package.json:

"expo": "~38.0.8",
"react": "~16.11.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.1.tar.gz",
"react-native-navigation-bar-color": "^2.0.1"

Android crash screen

neel-dedhia commented 3 years ago

Hey @thebylito, on installing the package my app starting crashing. After running adb logcat I found that I am getting an classNotFoundException for class MainApplication.

azashi commented 3 years ago

Hi, @bjornarhagen , try rebuilding your app. In my case, I uninstalled the app and reinstalled it and TypeError: null is not an object (evaluating 'NavigationBarColor.changeNavigationBarColor') was resolved

OoDeLally commented 3 years ago

I have the same error... Did anyone manage to solve it? :shrug:

vi07 commented 3 years ago

Rebuilding the app solved my error.

GautierBlandin commented 2 years ago

Well, I just installed this package and I also have this problem :/

To be more precise, the error seems to be on the evaluation of Platform.OS, which is apparently not defined.

AymaneShadow commented 1 year ago

I have the same problem:

"[TypeError: null is not an object (evaluating 'NavigationBarColor.changeNavigationBarColor')]"

Keeps showing up no matter what I do, like:

{
  "expo": {
    ...
    "androidNavigationBar": {
      "visible": true,
      "barStyle": "light-content",
      "backgroundColor": "#004D40"
    },
    ...
  }
}

The down side of this last method is that it can't be done at runtime, which is what react-native-navigation-bar-color is supposed to do but unfortunately it crashes with the error message I mentioned.

Dependencies:

Is anyone else having the same problem?