0

I got the following message:

The following classes could not be instantiated: - android.support.v7.widget.GridLayout (Open Class, Show Error Log)

So I looked for a solution and I found that:

  1. Setting up Android support package v7 for eclipse - GridLayout Not working
  2. Gridview v7 support for older api android.support.v7.widget.Gridlayout failed to instaniate Not working
  3. Eclipse giving an error of android.support.v7.widget.GridLayout failed to instantiate Not working

Yes, none of these solutions worked for me...

Here is the layout.xml which is pretty simple:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

</android.support.v7.widget.GridLayout>

Minimum API is 10.

Thanks.

Community
  • 1
  • 1
ChAndroid
  • 35
  • 8
  • Have you added its support-v7-gridlayout library in your project? – GrIsHu Dec 23 '13 at 11:24
  • Have you tried to clean your project? Can you show the screenshot of your layout with error? – GrIsHu Dec 23 '13 at 13:01
  • Here is two screenshorts http://img4.hostingpics.net/pics/135233screen1.png http://img4.hostingpics.net/pics/509245screen2.png – ChAndroid Dec 23 '13 at 13:08
  • Well, I just found the issue. I had to update the android-support-v4.jar... Sorry, but sometime, I'm so dumb. Anyway, thanks for your help. – ChAndroid Dec 23 '13 at 13:46

1 Answers1

2

Try out as below:

File->Import->Existing Android code into workspace Specify android-sdk-[platform]/extras/android/support/v7/gridlayout and add the project library of GridLayout in your workspace.

After importing library into your workspace you need to import the GridLayout library project as an Android library project in your project to make it work.

EDIT: For all who have this issue, try to update the android-support-v4.jar.

Erik Öjebo
  • 10,821
  • 4
  • 54
  • 75
GrIsHu
  • 29,068
  • 10
  • 64
  • 102