question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BottomNavigator] Error when migrated to version 1.3.0

See original GitHub issue

Hi,

When i migrate from version 1.2.1 to version 1.3.0 i get this error:

2021-02-11 21:46:46.447 16352-16352/br.com.ubook.ubookapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: br.com.ubook.ubookapp, PID: 16352
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.ViewGroup.getPaddingBottom()' on a null object reference
        at com.google.android.material.bottomnavigation.BottomNavigationItemView.<init>(BottomNavigationItemView.java:108)
        at com.google.android.material.bottomnavigation.BottomNavigationItemView.<init>(BottomNavigationItemView.java:89)
        at com.google.android.material.bottomnavigation.BottomNavigationItemView.<init>(BottomNavigationItemView.java:85)
        at com.google.android.material.bottomnavigation.BottomNavigationMenuView.getNewItem(BottomNavigationMenuView.java:634)
        at com.google.android.material.bottomnavigation.BottomNavigationMenuView.buildMenuView(BottomNavigationMenuView.java:563)
        at com.google.android.material.bottomnavigation.BottomNavigationPresenter.updateMenuView(BottomNavigationPresenter.java:67)
        at com.google.android.material.bottomnavigation.BottomNavigationView.inflateMenu(BottomNavigationView.java:349)
        at br.com.ubook.ubookapp.ui.fragment.MainFragment.createAll(MainFragment.kt:185)
        at br.com.ubook.ubookapp.ui.fragment.BaseFragment.onCreateView(BaseFragment.kt:127)
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2699)
        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:320)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1199)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368)
        at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1509)
        at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
        at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2181)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2004)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1959)
        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1861)
        at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2641)
        at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2589)
        at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:247)
        at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:541)
        at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:210)
        at br.com.ubook.ubookapp.ui.activity.BaseActivity.onStart(BaseActivity.kt:552)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391)
        at android.app.Activity.performStart(Activity.java:7348)
        at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3138)
        at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
        at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7050)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

The line with error is:

navigationLeft.inflateMenu(R.menu.navigation_left_3)

And the content is:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:id="@+id/tab_home_left"
        android:icon="@drawable/ic_tab_home"
        android:title="@string/title_featured" />

    <item
        android:id="@+id/tab_my_products_left"
        android:icon="@drawable/ic_tab_my_products"
        android:title="@string/title_my_products" />

</menu>

I revert it to 1.2.1 to make it work for now.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
paulocoutinhoxcommented, Mar 25, 2021

Our friend here found the problem.

We have created a new file “res/layout/design_bottom_navigation_item.xml” to replace the original and add our accessibility text.

But it has 3 years and our file don’t have the ID field that is recently added android:id="@+id/labelGroup" causing the crash.

We only need add this ID on BaseLineLayout element and it was fixed.

Thanks.

0reactions
Prakhar-kulscommented, Nov 30, 2022

@hemalHD what is the version you are using for com.google.android.material:material in app’ build:gradle and in any of module or dependency? Can you check in dependency graph if 1.2.1 is being used.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem upgrading my Fragment's Navigation version(from ...
Locale)'' error when using Gradle 6.7.0 due to a dependency on an older version of Kotlin. This can be worked around by updating...
Read more >
Navigation | Android Developers
Fixed a crash caused by fast switching between bottom destinations when using the Navigation Compose NavHost .
Read more >
Support multiple back stacks for Bottom tab navigation
Click on one of the buttons (REGISTER or BLANK) in About fragment in order to navigate to corresponding destination. 3. App crashes with...
Read more >
Changelog - Cypress Documentation
When a chromium based browser tab or process crashes, Cypress will no longer hang indefinitely but will fail the current test and move...
Read more >
Changelog - Streamlit Docs
To upgrade to the latest version of Streamlit, run: ... st.info , st.success , st.error , and st.warning got a redesign and have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found