GridLayout Compatibility - ClassNotFoundException: class "android.support.v7.widget.GridLayout" not found

I am trying to use GridLayout in my Android 2.2 project and after installing the gridlayout_v7 project in my workspace, adding it to my Android Dependencies projects, adding custom xmlns for my custom attributes and embedding it in my xml layout as such:

<android.support.v7.widget.GridLayout android:layout_width="match_parent" android:layout_height="300dp" grid:columnCount="2" grid:rowCount="3" > <include android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/quick_contact" /> <include android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/quick_contact" /> <include android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/quick_contact" /> <include android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/quick_contact" /> <include android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/quick_contact" /> <include android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/quick_contact" /> </android.support.v7.widget.GridLayout> 

At runtime, I started getting the following exception:

 java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.GridLayout" on path: DexPathList[[zip file "system/framework/android.test.runner.jar", zip file "data/app/<app package>.apk"], nativeLibraryDirectories=[data/app-lib/<app package>, /vendor/lib, /system/lib]] 

I tried to clean and rebuild by deleting the library and adding it again, but to no avail. Any ideas as to what could be causing this?

+4
source share
1 answer

I saw this error. For me, I had to turn on the grid diagram exactly in my dependencies, for example:

 dependencies { ... compile 'com.android.support:gridlayout-v7:18.0.+' } 

For more information on how to enable support libraries, see here https://developer.android.com/tools/support-library/features.html

+1
source

Source: https://habr.com/ru/post/1502053/


All Articles