Khawaja Absar Khawaja Absar - 4 months ago 33
Android Question failed to instantiate

I'm trying to use a

in my project, but ideally with the Android Support Library so I can target lower versions of the API. When I drag a
into the graphical layout designer, a message pops up asking explaining I need a compatibility library for API versions older than 14, and asks if I want to install this library. I hit "Install" and let Eclipse do its thing, but an error shows up in the Eclipse graphical layout designer:

The following classes could not be instantiated: - See the Error Log ( Window > Show View) for more details."

(here is screenshot )

From the error log,
failed to instantiate.


Make sure you have added the GridLayout library project in your project as library.

Try out as below to import the library project of GridLayout

File->Import->Existing Android code into workspace Specify android-sdk-[path]/extras/android/support/v7/gridlayout

Make sure You import and copy the GridLayout project as an Android library project into your workspace.

After import library project add it into your project as library as below:

Right click your Project->Properties->Java Build Path->Order and Export where tick mark all option.