Setting up Android support package v7 for eclipse - GridLayout

前端 未结 7 1084
再見小時候
再見小時候 2020-12-24 06:08

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.
相关标签:
7条回答
  • 2020-12-24 06:21

    Edit you project's (and library project's too) .classpath file like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
        <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
        <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
        <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="src" path="gen"/>
        <classpathentry kind="output" path="bin/classes"/>
    </classpath>
    
    0 讨论(0)
  • 2020-12-24 06:30

    The support-v7-gridlayout.jar revision 7 had some issues. Now it was updated to revision 8, see compatibility-library just update it and its gonna work. Dont forget to change the support package for all of your library and dependencies or you gotcha an error of mismatch.

    0 讨论(0)
  • 2020-12-24 06:35

    If someone is having same problem here's a solution that worked for me:

    After importing project into a workspace you need to add it as a dependency using Android tab and not Java Build Path

    Project -> Properties -> Android -> Library -> [Add...]

    I also ticked Is Library.

    0 讨论(0)
  • 2020-12-24 06:36

    I use intellij idea, so it's not exactly your case, but maybe it will be helpfull. I struggled with setting this up whole day, then it suddenly worked. I'll describe my setup so you can compare:

    1. setup the GridLayout project as library project. Example of setting up can be found at android developer site here
    2. setup your main project as usual, reference the library project as described in the link above.
    3. add libraries to your main project. I used latest android-support-v13.jar and android-support-v7-gridlayout.jar. NOTE: I used the v7 support library in the main project, not the library project. In fact, checking it now - in library project I don't reference the v7 support.
    4. Use full package name in the layout file: <android.support.v7.widget.GridLayout /> instead of <GridLayout />
    5. use custom namespace, something like this: xmlns:grid="http://schemas.android.com/apk/res-auto" in your layout file to use custom attributes defined in the library project in your tag, like grid:columnCount

    hope this helps. I'm currently trying it, not even sure it is something I need :)

    0 讨论(0)
  • 2020-12-24 06:37

    Copy android-support-v7-gridlayout.jar from the folder Android_SDK_folder\extras\android\support\v7\gridlayout\libs. Then, paste it in your project MyAndroidProject\libs folder.

    0 讨论(0)
  • 2020-12-24 06:42

    To make 7v Samples (/extras/android/support/samples/Support7Demos/) to work, do the following:

    1. Import all projects from here /extras/android/support/v7
    2. Create /libs directory for Support7Demos project
    3. Put all *.jar files in /libs directory of these projects and add them to Support7Demos/libs
    0 讨论(0)
提交回复
热议问题