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
218 stars 80 forks source link

[BottomNavigation][Vue] Resources$NotFoundException #224

Open georgemark0v opened 3 years ago

georgemark0v commented 3 years ago

"@nativescript-community/ui-material-bottomnavigationbar": "^5.1.16"

Component layout

<MDBottomNavigationBar activeColor="red" inactiveColor="yellow" backgroundColor="black" @tabSelected="onBottomNavigationTabSelected" row="1">
                    <MDBottomNavigationTab title="First" icon="res://ic_contacts" />
                    <MDBottomNavigationTab title="Second" icon="res://ic_chats"  />
                    <MDBottomNavigationTab title="Third" icon="res://ic_profile" />
</MDBottomNavigationBar>

https://yadi.sk/i/fhmqAQvFpG0iew

Error:

System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onCreateView failed
System.err: Error: android.content.res.Resources$NotFoundException: Resource ID #0x0
System.err: 
System.err: StackTrace:
System.err: createNativeView(file: node_modules/@nativescript-community/ui-material-bottomnavigationbar/bottomnavigationbar.android.js:74:15)
System.err:     at _setupUI(file: src/packages/core/ui/core/view-base/index.ts:782:21)
System.err:     at (file: src/packages/core/ui/core/view-base/index.ts:831:9)
System.err:     at eachChildView(file: src/packages/core/ui/layouts/layout-base-common.ts:125:18)
System.err:     at eachChild(file: src/packages/core/ui/core/view/view-common.ts:867:7)
System.err:     at _setupUI(file: src/packages/core/ui/core/view-base/index.ts:830:7)
System.err:     at (file: src/packages/core/ui/core/view-base/index.ts:831:9)
System.err:     at eachChildView(file: src/packages/core/ui/content-view/index.ts:77:3)
System.err:     at eachChildView(file: src/packages/core/ui/page/page-common.ts:145:8)
System.err:     at eachChild(file: src/packages/core/ui/core/view/view-common.ts:867:7)
System.err:     at _setupUI(file: src/packages/core/ui/core/view-base/index.ts:830:7)
System.err:     at _addViewCore(file: src/packages/core/ui/core/view-base/index.ts:666:8)
System.err:     at _addView(file: src/packages/core/ui/core/view-base/index.ts:652:7)
System.err:     at onCreateView(file: src/packages/core/ui/frame/index.android.ts:905:9)
System.err:     at onCreateView(file: src/packages/core/ui/frame/fragment.android.ts:32:31)
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:1188)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1175)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1153)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1149)
System.err:     at com.tns.FragmentClass.onCreateView(FragmentClass.java:55)
System.err:     at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2699)
System.err:     at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:320)
System.err:     at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1199)
System.err:     at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368)
System.err:     at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446)
System.err:     at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1509)
System.err:     at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
System.err:     at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2181)
System.err:     at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2004)
System.err:     at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1959)
System.err:     at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1861)
System.err:     at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:413)
System.err:     at android.os.Handler.handleCallback(Handler.java:873)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:99)
System.err:     at android.os.Looper.loop(Looper.java:214)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:7156)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
System.err: Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
System.err:     at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:228)
System.err:     at android.content.res.Resources.getColorStateList(Resources.java:1046)
System.err:     at android.content.Context.getColorStateList(Context.java:644)
System.err:     at androidx.appcompat.content.res.AppCompatResources.getColorStateList(AppCompatResources.java:69)
System.err:     at com.google.android.material.bottomnavigation.BottomNavigationMenuView.createDefaultColorStateList(BottomNavigationMenuView.java:494)
System.err:     at com.google.android.material.bottomnavigation.BottomNavigationMenuView.<init>(BottomNavigationMenuView.java:113)
System.err:     at com.google.android.material.bottomnavigation.BottomNavigationMenuView.<init>(BottomNavigationMenuView.java:98)
System.err:     at com.google.android.material.bottomnavigation.BottomNavigationView.<init>(BottomNavigationView.java:145)
System.err:     at com.google.android.material.bottomnavigation.BottomNavigationView.<init>(BottomNavigationView.java:133)
System.err:     at com.google.android.material.bottomnavigation.BottomNavigationView.<init>(BottomNavigationView.java:129)
System.err:     ... 26 more
farfromrefug commented 3 years ago

It would seem you have a build issue. Remove platforms / node_modules and start over

georgemark0v commented 3 years ago

It would seem you have a build issue. Remove platforms / node_modules and start over

Its my mistake in styles i have

<item name="android:textColor">#F5FAFF</item>
<item name="android:textColorPrimary">#F5FAFF</item>
<item name="android:textColorSecondary">#F5FAFF</item>

color property should be @color/textColor

farfromrefug commented 3 years ago

@georgemark0v great you found it! Can you close this ?