You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to android developing and I've been facing some problems on adding this library to my project. I'm using android studio flamingo 2022. When I execute the app I end up getting the error log:
java.lang.RuntimeException: Unable to start activity ComponentInfo{app.project.jabayo/app.project.jabayo.activity.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3909) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4055) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2415) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:211) at android.os.Looper.loop(Looper.java:300) at android.app.ActivityThread.main(ActivityThread.java:8395) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.getBottomNavigationItemViews(BottomNavigationViewEx.java:569) at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.enableAnimation(BottomNavigationViewEx.java:341) at app.project.jabayo.activity.MainActivity.bottomNavigationViewConfig(MainActivity.java:66) at app.project.jabayo.activity.MainActivity.onCreate(MainActivity.java:43) at android.app.Activity.performCreate(Activity.java:8538) at android.app.Activity.performCreate(Activity.java:8502) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1440) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3890) ... 12 more
The line 21 of my file bottom_navigation.xml calls the bottom navigation menu, like this:
app:menu="@menu/menu_bottom_navigation" />
The file menu_bottom_navigation.xml only contains the icons for the bottom navigation bar.
I checked the BottomNavigationViewEX.java file and it didn't have any error but the BottomNavitagionViewInner.java had the "Library source does not match the bytecode for class BottomNavigationViewInner" error.
I also couldn't find the com.google.android.material.R$styleable class.
I belive the problem can be related to the 'com.google.android.material:material:1.5.0' implementation. These are my build.gradle (app) dependencies:
I'm new to android developing and I've been facing some problems on adding this library to my project. I'm using android studio flamingo 2022. When I execute the app I end up getting the error log:
java.lang.RuntimeException: Unable to start activity ComponentInfo{app.project.jabayo/app.project.jabayo.activity.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3909) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4055) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2415) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:211) at android.os.Looper.loop(Looper.java:300) at android.app.ActivityThread.main(ActivityThread.java:8395) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.getBottomNavigationItemViews(BottomNavigationViewEx.java:569) at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.enableAnimation(BottomNavigationViewEx.java:341) at app.project.jabayo.activity.MainActivity.bottomNavigationViewConfig(MainActivity.java:66) at app.project.jabayo.activity.MainActivity.onCreate(MainActivity.java:43) at android.app.Activity.performCreate(Activity.java:8538) at android.app.Activity.performCreate(Activity.java:8502) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1440) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3890) ... 12 more
The line 21 of my file
bottom_navigation.xml
calls the bottom navigation menu, like this:app:menu="@menu/menu_bottom_navigation" />
The file
menu_bottom_navigation.xml
only contains the icons for the bottom navigation bar.I checked the
BottomNavigationViewEX.java
file and it didn't have any error but theBottomNavitagionViewInner.java
had the "Library source does not match the bytecode for class BottomNavigationViewInner" error.I also couldn't find the
com.google.android.material.R$styleable
class.I belive the problem can be related to the
'com.google.android.material:material:1.5.0'
implementation. These are my build.gradle (app) dependencies:`dependencies {
}`
And my setting.gradle:
pluginManagement { repositories { google() mavenCentral() gradlePluginPortal() } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven { url "https://jitpack.io" } maven { url "https://maven.google.com" } } } rootProject.name = "Jabayo" include ':app'
I apologize if my question is a bit confusing, I really am new to this.
The text was updated successfully, but these errors were encountered: