nativescript-community / ui-material-components

Monorepo that contains all of the NativeScript Material Design plugins.
https://nativescript-community.github.io/ui-material-components/
Apache License 2.0
219 stars 80 forks source link

MDBottomNavigation #410

Closed Bheam closed 2 years ago

Bheam commented 2 years ago

Ok I give up... MDBottomNavigation doesn't work for nativescript-vue on android.

I actually just wanted to use the BottomNavigation that used to be in nativescript core, but was removed, i don't need the MD versions, but I can't find any info how to do that. Do i need to downgrade to NS7 ?

Also I tried the MDBottomNavigationBar as well, it seems to work, but the icon can't be styled so i can't use fontawesome. Also it seems to have some minor bugs (such as selectedtab being called twice on tap)

Anyway here's the error when using MDBottomNavigation:

System.err: An uncaught Exception occurred on "main" thread. System.err: Calling js method onCreateView failed System.err: TypeError: Cannot read property 'material' of undefined System.err: System.err: StackTrace: System.err: initializeNativeClasses(file: app\webpack:\Treffes\node_modules\@nativescript-community\ui-material-bottom-navigation\index.android.js:35:1) System.err: at createNativeTabBar(file: app\webpack:\Treffes\node_modules\@nativescript-community\ui-material-bottom-navigation\index.android.js:57:0) System.err: at handleTabStripChanged(file: app\webpack:\Treffes\node_modules\@nativescript-community\ui-material-core-tabs\tab-navigation\index.android.js:199:0) System.err: at createNativeView(file: app\webpack:\Treffes\node_modules\@nativescript-community\ui-material-core-tabs\tab-navigation\index.android.js:186:0) System.err: at _setupUI(file: app\webpack:\Treffes\node_modules\@nativescript\core\ui\core\view-base\index.js:557:0) System.err: at (file: app\webpack:\Treffes\node_modules\@nativescript\core\ui\core\view-base\index.js:603:0) System.err: at eachChildView(file: app\webpack:\Treffes\node_modules\@nativescript\core\ui\layouts\layout-base-common.js:101:0) System.err: at eachChild(file: app\webpack:\Treffes\node_modules\@nativescript\core\ui\core\view\view-common.js:772:0) System.err: at _setupUI(file: app\webpack:\Treffes\node_modules\@nativescript\core\ui\core\view-base\index.js:602:0) System.err: at (file: app\webpack:\Treffes\node_modules\@nativescript\core\ui\core\view-base\index.js:603:0)

"@nativescript/core": "~8.3.0", "nativescript-vue": "~2.9.0", "vue-class-component": "^6.3.2", "vue-property-decorator": "^7.3.0"

"@nativescript/android": "8.3.1", "vue": "~2.6.12"

"@nativescript-community/ui-material-bottom-navigation": "^7.0.28",
"@nativescript-community/ui-material-bottomnavigationbar": "^7.0.28",
"@nativescript-community/ui-material-tabs": "^7.0.28",

Running on android emulator.

farfromrefug commented 2 years ago

@Bheam for some reason your build does not see the android material libs at runtime. Tbh I can't say why just like that. If you share the project we can help you. Your true error might be higher in your build logs

Bheam commented 2 years ago

Well no errors on the build log - also it's not the material libs it can't find, it's looking up "com.nativescript.material.core.BottomNavigationBar" and com.nativescript is undefined - I find it a weird syntax to begin with. I didn't think namespaces like that was available in code.

But i'll see if i can cook up a minimal example.

Bheam commented 2 years ago

I appologize. platform remove finally fixed it for me.

radudiaconu0 commented 4 weeks ago

@Bheam what did you do exactly? i have the same problem?

farfromrefug commented 4 weeks ago

@radudiaconu0 did you try a full clean build? Usually it solves those issues. Happens to me quite often