0

I am doing the Android first app tutorial from http://developer.android.com/training/basics/firstapp/starting-activity.html.

I am trying to use FloatingActionButton but it is not recognised by Android Studio.

I have added this import:

import android.support.design.widget.FloatingActionButton;

But it is also not found.

Do I need to add any other dependencies?

If I add compile 'com.android.support:design:23.2.1' to the module's build.gradle I get:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.android.support:design:23.2.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/design/23.2.1/design-23.2.1.pom
         https://jcenter.bintray.com/com/android/support/design/23.2.1/design-23.2.1.jar
         file:/Users/octavian/Library/Android/sdk/extras/android/m2repository/com/android/support/design/23.2.1/design-23.2.1.pom
         file:/Users/octavian/Library/Android/sdk/extras/android/m2repository/com/android/support/design/23.2.1/design-23.2.1.jar
         file:/Users/octavian/Library/Android/sdk/extras/google/m2repository/com/android/support/design/23.2.1/design-23.2.1.pom
         file:/Users/octavian/Library/Android/sdk/extras/google/m2repository/com/android/support/design/23.2.1/design-23.2.1.jar
     Required by:
         MyFirstApp:app:unspecified 
bsky
  • 19,326
  • 49
  • 155
  • 270

3 Answers3

0

add your gradle Support Design Library

compile 'com.android.support:design:23.2.1'
Oğuzhan Döngül
  • 7,856
  • 4
  • 38
  • 52
0

You can use one of them

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

Version 23.2 buggy . See details Android Studio FloatingActionButton error

Community
  • 1
  • 1
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
0

Add this:

dependencies {
    compile 'com.android.support:appcompat-v7:23.+'
    compile 'com.android.support:design:23.+'
}
Thomas Bormans
  • 5,156
  • 6
  • 34
  • 51
Basi
  • 3,009
  • 23
  • 28