How to Add "Android Design Support Library" to Eclipse with Adt-Plugin

How to add Android Design Support Library to Eclipse with ADT-plugin?

Before use the design support library, you have to import support-v7-appcompat library from android-sdks\extras\android\support\v7\appcompat. Then, you have to:

  • create an android library project in eclipse for design support library
  • put the contents of directory android-sdks\extras\android\support\design in the design support library project
  • Link appcompat-v7 library to design support library project
  • Link support library project from your project.

Note: If you can't find the design folder you might want to try this location instead:
android-sdk\extras\android\m2repository\com\android\support\design

You can not use directly the jar android-support-design.jar because you need some resources too (this is the reason of aar format).

For more info just check Error in styles_base.xml file - android app - No resource found that matches the given name 'android:Widget.Material.ActionButton'

How do I attach the Android Support Library source in Eclipse?

After downloading the support package from the Android SDK Manager, you can find the source code of support package in folder <android-sdks>/extras/android/support/v4/src.

Android support library not installed in Eclipse 2018

Eclipse was deprecated a while back as the development environment for Android, so is very likely that most of the libraries you want to use will no longer work with it.

You must use instead Android Studio.

Eclipse with ADT instead of Android Studio

I wouldn't use the legacy plugin. I know, google is very strict in their marketingplans, but if you get this working its only a temporal solutions for only a few release versions. Intellij is a very good ide in my opinion. When google starts first level support for such a powerful environment, i would recommend to spend some money in new hardware. Especially when its for free.

Using TabLayout in Android Eclipse project

With the help of a few other answers I finally managed to import everything. Putting it all together, just copyiing the jar into libs will not be sufficient. Here's how it works in Andmore (ADT should be similar but some options apparently differ):

  • Make sure your SDK is up to date. Specifically, you want the latest version of Extras > Android Support Library (should be version 22 or higher) and a matching version of Tools > Android SDK Build-tools.
  • If you have a copy of android-support-v4.jar in the libs folder of your app's source tree, replace it with a recent copy from <sdk>/extras/android/support/v7/appcompat/libs. (If you have other Android support JARs in that location, you may need to update those as well.)
  • Copy <sdk>/extras/android/support/v7/appcompat and <sdk>/extras/android/support/design into your workspace folder. (Not really necessary, but using a local copy will prevent polluting your SDK setup with Eclipse-generated files.
  • Select File > New... > Android Project.
  • Select Create project from existing source and select your copy of the appcompat folder. Be sure to select at least API 22 as a build target (I needed to use API 23, YMMV), and don't forget to give it a meaningful name.
  • When import has finished, open the properties of the new project, go to Android and check Is Library.
  • Repeat the same two steps to import the design library. After import, in its project properties, go to Android, and in Libraries add a reference to the appcompat project.
  • Open the properties of your app project, go to Android, and in Libraries add a reference to the design project.

I had to make some minor modifications to my source code as some resource identifiers are no longer constants as of API 14, requiring me to convert a switch statement to a series of ifs. After that, I could finally build my app.

This should work for other Android libraries as well – their locations are documented in http://developer.android.com/tools/support-library/features.html.

Edit: There may be an easier way: Both ADT and Andmore also have Android Tools > Add Support Library, which might make a few of the aforementioned steps easier, which installs the most recent version of the support library. But you still have to add them to your project by hand.

How to add Android Support v7 libraries in eclipse?

From: https://developer.android.com/tools/support-library/setup.html#libs-with-res

I know this looks like a lot of steps, but in reality it's just very broken down and only takes two minutes

To add a Support Library with resources (such as v7 cardview) to your application project using Eclipse:

Create a library project based on the support library code:

  • Make sure you have downloaded the Android Support Library using the SDK Manager.

  • Create a library project and ensure the required JAR files are included in the project's build path:

  • Select File > Import.

  • Select Existing Android Code Into Workspace and click Next.

  • Browse to the SDK installation directory and then to the Support Library folder. For example, if you are adding the cardview project, browse to <sdk>/extras/android/support/v7/cardview/.

  • Click Finish to import the project. For the v7 cardview project, you should now see a new project titled android-support-v7-cardview.

  • In the new library project, expand the libs/ folder, right-click each .jar file and select Build Path > Add to Build Path. For example, when creating the v7 cardview project, add the android-support-v7-cardview.jar file to the build path. (Depending on your setup, Eclipse may have done this four you already.)

  • Right-click the library project folder and select Build Path > Configure Build Path.

  • In the Order and Export tab, check the .jar files you just added to the build path, so they are available to projects that depend on this library project. For example, the cardview project requires you to export the android-support-v7-cardview.jar file. (Depending on your setup, Eclipse may have done this four you already.)

  • Uncheck Android Dependencies.

  • Click OK (or Apply and Close) to complete the changes.

You now have a library project for your selected Support Library that you can use with one or more application projects.

Now add the library to your application project:

  • In the Project Explorer, right-click your project and select Properties.

  • In the category panel on the left side of the dialog, select Android.

  • In the Library pane, click the Add button.

  • Select the library project and click OK. For example, the appcompat project should be listed as android-support-v7-cardview.

  • In the properties window, click OK (or Apply and Close).

For some libraries, you will get error messages such as

No resource found that matches the given name 'android:Widget.Material.ActionButton'. styles_base.xml/appcompat_v7/res/values-v21

If that happens, record the highest API level you are seeing in those error messages (v21 in the example above). Then, in the properties of your library project, go to Android and set the target API to that level (or a higher one), then clean your projects.

Can't find v7 Preference Support Library in Eclipse ADT

Google stopped to provide Eclipse projects. It pushes developers to migrate from Eclipse to Android Studio. So all libraries are available as *.aar files

But it is still possible to these files in Eclipse.
Find the aar for your library at \android-sdk\extras\android\m2repository\com\android\support\preference-v7\23.0.1\

Then use instructions from CommonsWare guy Consuming AARs from Eclipse:

  1. UnZIP the AAR into some directory.

  2. Create an empty directory that will be the home for the Android
    library project. For the rest of these steps, I will refer to this as
    “the output directory”.

  3. Copy the AndroidManifest.xml, res/, and assets/ directories from the
    AAR into the output directory.

  4. Create a libs/ directory in the output directory. Copy into libs/ the
    classes.jar from the root of the unZIPped AAR, plus anything in libs/
    in the AAR (e.g., mediarouter-v7 has its own JAR of proprietary bits).

  5. Decide what build SDK you want to try to use. You might just choose
    the highest SDK version you have installed. Or, you can use the
    android:minSdkVersion and the -vNN resource set qualifiers to get
    clues as to what a good build SDK might be. If desired, create a
    project.properties file with a target=android-NNN line, where NNN is
    your chosen build SDK. Or, you can address this in Eclipse later on.

  6. Import the resulting project into Eclipse, and if needed adjust the
    build SDK (Project > Properties > Android). Also, you will need to
    attach to this library project any library projects it depends upon
    (e.g., mediarouter-v7 depends upon appcompat-v7).

How to create n project with ADT r20 without including the android support library?

Go the SDK_Folder/extra/android and rename the folder compatibility to support. After that, restart the Eclipse.

cannot find android support library

Make sure you have added the dependency:

compile 'com.android.support:design:23.1.1'

Then import:

import android.support.design.widget.TabLayout;


Related Topics



Leave a reply



Submit