0

I am working with bottom navigation I have the below code in my xml to get bottom nagvigation, but when I run the app I keep on getting this below exception.

Here is my xml code

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.activatic.paychek.HomeActivity">

    <FrameLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:background="#f1f1f1">

    </FrameLayout>


    <!--<android.support.v4.widget.NestedScrollView
        android:id="@+id/myScrollingContent"
        android:layout_width="match_parent"
        android:layout_height="match_parent">


    </android.support.v4.widget.NestedScrollView>-->
   <android.support.design.widget.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        app:itemBackground="@color/colorPrimary"
        app:itemIconTint="@color/white"
        app:itemTextColor="@color/white"
        app:menu="@menu/bottom_nav_items" />

   <!-- <android.support.design.widget.BottomNavigationView
        android:id="@+id/navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        app:menu="@menu/bottom_nav_items" />-->
</RelativeLayout>

This is the exception that I am facing.

java.lang.NoSuchMethodError: No static method combineMeasuredStates(II)I in class Landroid/support/v7/widget/ViewUtils; or its super classes (declaration of 'android.support.v7.widget.ViewUtils' appears in /data/app/com.activatic.paychek-2/base.apk:classes5.dex)
    at android.support.design.internal.BaselineLayout.onMeasure(BaselineLayout.java:69)
    at android.view.View.measure(View.java:19857)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
    at android.view.View.measure(View.java:19857)
    at android.support.design.internal.BottomNavigationMenuView.onMeasure(BottomNavigationMenuView.java:143)
    at android.view.View.measure(View.java:19857)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
    at android.view.View.measure(View.java:19857)
    at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
    at android.view.View.measure(View.java:19857)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
    at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
    at android.view.View.measure(View.java:19857)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
    at android.view.View.measure(View.java:19857)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
    at android.view.View.measure(View.java:19857)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
    at android.view.View.measure(View.java:19857)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
    at com.android.internal.policy.DecorView.onMeasure(DecorView.java:689)
    at android.view.View.measure(View.java:19857)
    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2275)
    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1366)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1619)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
    at android.view.Choreographer.doCallbacks(Choreographer.java:686)
    at android.view.Choreographer.doFrame(Choreographer.java:621)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
    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)

Below is my build.gradle file please find and let me know this are all dependecies I am using.

dependencies {
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':ccp')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //    compile 'com.google.android.gms:play-services:11+'
    //    compile 'com.google.android.gms:play-services-auth:11+'
    //noinspection GradleCompatible
    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    //noinspection GradleCompatible
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.squareup:otto:1.3.8'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.squareup.retrofit2:converter-gson:2.0.2'
    compile 'com.squareup.okhttp3:logging-interceptor:2.0.2'
    compile 'com.squareup.okhttp:okhttp:2.7.5'
    compile 'com.google.code.gson:gson:2.7'
    //noinspection GradleCompatible
    // compile 'com.google.android.gms:play-services:11.0.4'
    compile 'com.android.support:multidex:1.0.0'

    //noinspection GradleCompatible
    compile 'com.android.support:animated-vector-drawable:25.3.1'
    //noinspection GradleCompatible
    compile 'com.android.support:mediarouter-v7:25.2.0'
    compile 'com.roughike:bottom-bar:1.4.0.1'
    compile 'com.github.ittianyu:BottomNavigationViewEx:1.2.4'
    compile 'com.facebook.android:account-kit-sdk:4.+'
    //noinspection GradleCompatible
    compile 'com.android.support:design:25.0.0'
    compile 'com.google.firebase:firebase-core:11.8.0'
    compile 'com.google.firebase:firebase-messaging:11.8.0'

    //noinspection GradleCompatible
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.github.moondroid.coverflow:library:1.0'
    testCompile 'junit:junit:4.12'
    compile 'com.squareup.okhttp3:logging-interceptor:3.9.0'
    compile 'com.jakewharton:butterknife:8.8.1'

    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    // compile 'com.google.firebase:firebase-messaging:11.0.4'
    //compile 'com.google.firebase:firebase-crash:11.0.4'
}

Any help would be appreciated!!

Sunil P
  • 3,698
  • 3
  • 13
  • 20

1 Answers1

-2

Please refer below link for your problem

Android new Bottom Navigation bar

https://github.com/roughike/BottomBar

with the help of this link, you can check what you doing in your code. what is an exact issue. so you have to compare your code to this one and check what you doing mistake

Vidhi Dave
  • 5,614
  • 2
  • 33
  • 55