henrychavez / nativescript-bottom-navigation

Nativescript plugin for Android & iOS to have the bottom navigation bar of Material Design
Apache License 2.0
58 stars 18 forks source link

App failing in android with the icons set on ns 5.0 #46

Closed afaridanquah closed 5 years ago

afaridanquah commented 5 years ago

I am having issues with the plugin on android, Works fine on iOS. I have placed the icons in //res/drawable-{hdpi, mdpi, xhdpi,xxhdpi,xxxhdpi} using the ic_{filename} . I am running ns 5.0 and vue

An uncaught Exception occurred on "main" thread. com.tns.NativeScriptException: Calling js method onCreateView failed

TypeError: Cannot read property 'android' of null File: "file:///data/data/com.zeepay.instntmny/files/app/vendor.js, line: 26355, column: 73

StackTrace: Frame: function:'BottomNavigation.createTabs', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 26355, column: 74 Frame: function:'BottomNavigation.(anonymous function)', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 26368, column: 10 Frame: function:'applyAllNativeSetters', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 59426, column: 22 Frame: function:'initNativeView', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 59353, column: 5 Frame: function:'ViewBase.onResumeNativeUpdates', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60461, column: 18 Frame: function:'ViewBase._resumeNativeUpdates', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 59994, column: 12 Frame: function:'ViewBase.onLoaded', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 59940, column: 10 Frame: function:'View.onLoaded', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 62143, column: 31 Frame: function:'', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60043, column: 20 Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60032, column: 5 Frame: function:'ViewBase.callLoaded', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60042, column: 10 Frame: function:'ViewBase.loadView', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60219, column: 12 Frame: function:'', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 59943, column: 13 Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 70852, column: 20 Frame: function:'ViewCommon.eachChild', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 61643, column: 10 Frame: function:'ViewBase.onLoaded', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 59942, column: 10 Frame: function:'View.onLoaded', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 62143, column: 31 Frame: function:'', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60043, column: 20 Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60032, column: 5 Frame: function:'ViewBase.callLoaded', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60042, column: 10 Frame: function:'ViewBase.loadView', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60219, column: 12 Frame: function:'', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 59943, column: 13 Frame: function:'ContentView.eachChildView', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 57587, column: 7 Frame: function:'PageBase.eachChildView', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 72279, column: 36 Frame: function:'ViewCommon.eachChild', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 61643, column: 10 Frame: function:'ViewBase.onLoaded', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 59942, column: 10 Frame: function:'View.onLoaded', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 62143, column: 31 Frame: function:'Page.onLoaded', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 72411, column: 31 Frame: function:'', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60043, column: 20 Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60032, column: 5 Frame: function:'ViewBase.callLoaded', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60042, column: 10 Frame: function:'ViewBase.loadView', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60219, column: 12 Frame: function:'ViewBase._addViewCore', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60213, column: 12 Frame: function:'ViewBase._addView', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 60192, column: 10 Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 67281, column: 13 Frame: function:'FragmentClass.onCreateView', file:'file:///data/data/com.zeepay.instntmny/files/app/vendor.js', line: 64876, column: 34

at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:996)
at com.tns.Runtime.callJSMethod(Runtime.java:983)
at com.tns.Runtime.callJSMethod(Runtime.java:967)
at com.tns.Runtime.callJSMethod(Runtime.java:959)
at com.tns.FragmentClass.onCreateView(FragmentClass.java:45)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2439)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:733)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
henrychavez commented 5 years ago

Hi @afaridanquah

can you send an example of your code and an image of your files in App_Resources/android because I just ran an example and it works as expected 😄

afaridanquah commented 5 years ago

Hi @henrychavez, can you please take a look at this repo https://github.com/afaridanquah/ns-tabs

henrychavez commented 5 years ago

@afaridanquah, as you can see in the examples the .png, is not necessary, remove that and should be working 👍

afaridanquah commented 5 years ago

That works, thanks @henrychavez.