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 
2

3 Answers 3

0

add your gradle Support Design Library

compile 'com.android.support:design:23.2.1'
Sign up to request clarification or add additional context in comments.

4 Comments

I get an error when adding the dependency. I updated my answer.
@octavian which gradle file are you adding this?
this one Module: app
@octavian so, if you update your question and add your gradle file, it will be more easier
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

Comments

0

Add this:

dependencies {
    compile 'com.android.support:appcompat-v7:23.+'
    compile 'com.android.support:design:23.+'
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.