How to Add Android Support V7 Libraries in Eclipse

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.

Unable to add appcompat support library in eclipse

See this answer

The import android.support.v7.app cannot be resolved

After you add appcompat_v7 to your dependencies, be sure that the libs folder from your project are empty. By default, an android-support-v4.jar is created when you define your project, so this will cause conflict when you declare appcompat_v7 library as your dependency.

So, the first thing you need to do is check the folder .../My_Project/libs and fearlessly delete the file android-support-v4.jar.

Then, add the appcompat_v7 library as a dependency of your project:
To do this, if you are using Eclipse:

  1. Right click in your project folder, located in the Navigator.
  2. Click in properties, in the final of the list.
  3. In the Properties window, select the Android option (left menu).
  4. In the box Library, add your new reference.

Support Library Setup -
https://developer.android.com/tools/support-library/setup.html

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.

Importing an app-compat v7 library eclipse project to android studio

Here's what I did: In the the project.properties file I deleted all dependencies, and while importing project in Android studio I simply followed the instructions (making sure the check box are ticked, especially the one that says add any dependency). And it worked.

The Import android.support.v7 cannot be resolved

  1. Go to your project in the navigator, right click on properties.

  2. Go to the Java Build Path tab on the left.

  3. Go to the libraries tab on top.

  4. Click add external jars.

  5. Go to your ADT Bundle folder, go to sdk/extras/android/support/v7/appcompat/libs.

  6. Select the file android-support-v7-appcompat.jar

  7. Go to order and export and check the box next to your new jar.

  8. Click ok.

How do I add a library (android-support-v7-appcompat) in IntelliJ IDEA

Without Gradle (Click here for the Gradle solution)

  1. Create a support library project.

  2. Import your library project to Intellij from Eclipse project (this step only applies if you created your library in Eclipse).

  3. Right click on module and choose Open Module Settings.

  4. Setup libraries of v7 jar file
    Setup libraries of v7 jar file

  5. Setup library module of v7
    Setup library module of v7

  6. Setup app module dependency of v7 library module
    Setup app module dependency of v7 library module

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'



Related Topics



Leave a reply



Submit