12

The Android Developers Blog announced in May 2015:

The Design library is available now, so make sure to update the Android Support Repository in the SDK Manager.

I am using Eclipse (Version: Luna 4.4.2) with latest ADT-plugin and don't see anything "design" in the SDK manager:

SDK manager

When trying to use android.support.design.widget.FloatingActionButton or android.support.design.widget.NavigationView in my projects like this one -

app screenshot

I unfortunately get errors:

Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.NavigationView" on path ...

If I would be using Android Studio, I probably needed the line

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

but how to fix this in Eclipse? Can I download a JAR file for the design library?

I have searched \sdk\extras\android\support\ path, but haven't found any.

Alexander Farber
  • 21,519
  • 75
  • 241
  • 416
  • 1
    did you tried using it as reference project? i was able to use google play services same way – karan Jul 15 '15 at 12:43
  • 1
    Here the info to setup: https://developer.android.com/tools/support-library/setup.html#libs-with-res: Time to switch to Android Studio – Gabriele Mariotti Jul 15 '15 at 12:52
  • No, it is about appcompat ( which works for me already ) - and not about design library – Alexander Farber Jul 15 '15 at 12:54
  • 2
    you have to put Jar file of support library in lib Folder and you are Done.you can find jar file from this path in SDK folder :: sdk\extras\android\support\design\libs –  Jul 15 '15 at 12:55
  • 1
    make sure you are using "Theme.AppCompat.[...]" in your base theme – karan Jul 15 '15 at 13:02

1 Answers1

29

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'

Community
  • 1
  • 1
xcesco
  • 4,690
  • 4
  • 34
  • 65
  • 1
    Thanks (+1), but unfortunately I get numerous resource-related errors like `extras\android\support\design\res\values\styles.xml:56: error: Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Button'.` – Alexander Farber Jul 15 '15 at 14:34
  • Hi! I have updated the answer. The design support library need the support-v7-appcompat library to be compiled. – xcesco Jul 16 '15 at 13:04
  • I still can't find the path `sdk\extras\android\support\design\libs` . I don't have design folder in my support folder – Jas Feb 18 '16 at 04:58
  • @Jas, did you have installed, with SDK manager, package "Android Support Library"? Folder you mentioned was installed when you select that module. – xcesco Feb 19 '16 at 10:10