I've been trying this all evening to no avail so I'm going to list my exact steps starting from scratch.
- I've installed the support package via SDK manager.
- I create a new android project which I call "testinggridlayout".
- The build target I select is Android 2.1 API 7.
- List item
This will be my project which I want to be able to create a grid layout on.
To set up the support package these are my steps:
- Right-click the project I've just created and select - New - Android Project
- Name it GridLayout and select create project from existing source
and browse to:
android-sdks\extras\android\support\v7\gridlayout
- Right-click my
testinggridlayout
project and click properties: - under Java Build Path - select the Projects tab, then Add.
- select my project "GridLayout" and click OK, then Ok.
At this point
If I go into the main.xml layout manually insert this code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<GridLayout
android:background="#FFFFFF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:columnCount="8"
android:rowCount="5" >
</GridLayout>
</LinearLayout>
I get the error:
The following classes could not be found: - GridLayout (fix build path, edit XML).
If I change
<GridLayout> & </GridLayout>
to
<android.support.v7.widget.GridLayout> & </android.support.v7.widget.Gridlayout>
I receive the same error:
The following classes could not be found: - android.support.v7.widget.GridLayout (fix build path, edit XML).
At that point I created a folder in my project called "libs".
I then copied the android-support-v7-GridLayout.jar file under libs in the GridLayout project to this folder.
I right clicked this file in my "libs" folder in "testinggridlayout" and selected "Add to Build Path".
My error then changed to:
The following classes could not be instantiated: - android.support.v7.widget.GridLayout (open class, show error log)
Which bit(s) have I missed out/ shouldn't have done?