ui-material-components icon indicating copy to clipboard operation
ui-material-components copied to clipboard

MDBottomNavigation crashes when Android system theme changes if SCSS styling applied.

Open JacobFJ opened this issue 4 years ago • 4 comments
trafficstars

Which platform(s) does your issue occur on?

  • Android
  • Android 11
  • Device (Xiaomi Mi 11) & Emulator (Pixel XL)

Please, provide the following version numbers that your issue occurs with:

Showing in error log attached that when user suddenly change their Android Theme from Light to Dark or vice-versa eventually app will crashed using SCSS.

  "dependencies": {
    "@nativescript-community/ui-material-bottom-navigation": "^5.3.2",
    "@nativescript/core": "~8.0.0",
    "@nativescript/theme": "~3.0.1",
    "nativescript-vue": "~2.9.0"
  },
  "devDependencies": {
    "@nativescript/android": "8.0.0",
    "@nativescript/types": "~8.0.0",
    "@nativescript/webpack": "beta",
    "@types/node": "~14.6.2",
    "nativescript-vue-template-compiler": "~2.9.0",
    "typescript": "~4.0.0",
    "vue": "~2.6.12"
  },

Please, tell us how to recreate the issue in as much detail as possible.

Using demo app. plus or any scss that style bottom navigation.

<style lang="scss">
$background: #ffffff;
$backgroundDark: #000000;
$text: #000000;
$textDark: #ffffff;

MDTabStrip {
  color: $inputDark;
  background-color: $background;

  .ns-dark & {
    color: $textDark;
    background-color: $backgroundDark;
  }
}

MDTabStripItem:highlighted {
  background-color: red;
  color: $textDark;
}
</style>

Is there any code involved?

Stack traces error.log

JacobFJ avatar May 28 '21 13:05 JacobFJ

@HakobiDev could you try latest? I should have avoided the crash.

farfromrefug avatar Jun 28 '21 09:06 farfromrefug

@farfromrefug thank you for your reply. Unfortunately the new version occurred new crash log also same in issue #313

Error: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.widget.LinearLayout.getChildAt(int)' on a null object reference

Log. error.log

JacobFJ avatar Jun 28 '21 16:06 JacobFJ

@farfromrefug I'm also experiencing this issue - the error only occurs when I navigate back to a page with a bottom nav. Navigating forward, no problem.

System.err: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.widget.LinearLayout.getChildAt(int)' on a null object reference
System.err:
System.err: StackTrace:
System.err: updateAndroidItemAt(file: app/webpack:/asc-avsv-nativescript/node_modules/@nativescript-community/ui-material-bottom-navigation/index.android.js:655:0)
System.err: 	at (file: app/webpack:/asc-avsv-nativescript/node_modules/@nativescript-community/ui-material-bottom-navigation/index.android.js:677:0)
System.err: 	at updateTabStripItems(file: app/webpack:/asc-avsv-nativescript/node_modules/@nativescript-community/ui-material-bottom-navigation/index.android.js:674:0)
System.err: 	at setTabBarBackgroundColor(file: app/webpack:/asc-avsv-nativescript/node_modules/@nativescript-community/ui-material-bottom-navigation/index.android.js:671:0)
System.err: 	at onBottomNavigationLoaded(file: app/webpack:/asc-avsv-nativescript/app/views/Home/Almanac/Almanac.ts:26:21)
...
  • @nativescript-community/ui-material-bottom-navigation - @6.2.3
  • @nativescript/android - @8.1.1

Ed-Simmons avatar Nov 15 '21 12:11 Ed-Simmons

@Ed-Simmons thanks for pinging me here! i think i found and. fixed the issue. Sadly i cant release anymore because of angular :s. Hope to have that fixed soon

farfromrefug avatar Nov 15 '21 15:11 farfromrefug