1
votes

Didn't find class "support.v4.view.ViewPager" on path: DexPathList[[zip file "/data/app/com.example.prakashgurung.atry-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.prakashgurung.atry-1/lib/arm, /system/lib, /vendor/lib]]

Here is my xml file

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.example.prakashgurung.atry.MainActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

        <android.support.design.widget.TabLayout
            android:id="@+id/mtab_ID"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_main" />

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        app:srcCompat="@android:drawable/ic_dialog_email" />

    <android:support.v4.view.ViewPager
        android:id="@+id/mViewpager_ID"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</android.support.design.widget.CoordinatorLayout>
1
Have you added the V4 support Core UI library to your build.gradle? compile 'com.android.support:support-core-ui:25.1.0' - Michael Dodd
I just added that, and I'm still getting the same error. - user7062312
Ok, just a few things to check. Have you downloaded the Android Support Library via the SDK Manager? Did you do a gradle sync after adding that to your build.gradle? Did you clean your project before testing it again? - Michael Dodd
Okay let me do that - user7062312
I just did everything you mentioned, no luck at the moment. - user7062312

1 Answers

0
votes

Found it. It's a typo. Change <android:support.v4.view.ViewPager to <android.support.v4.view.ViewPager. (Note the colon after android, should be a dot).