5

I am trying to use Floating Action Button(FAB) in my application. However, when I am declaring the same I get the error:

android.support.design.widget.FloatingActionButton could not be instantiated.

I have added following commands to my gradle file:

compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'

I have also tried with adding following to my style parent:

parent="@style/Theme.AppCompat"

Also tried having my Activity class extend Activity as well as AppCompatActivity.

Am I missing something? Pls. help

Ritu Raj
  • 543
  • 2
  • 6
  • 23

2 Answers2

2

Android build system uses the Android Plugin for Gradle to support building Android applications with the Gradle build toolkit. The plugin runs independent of Android Studio so the plugin and the Gradle build system can be updated independently of Android Studio.

For FloatingActionButton requirement

Please update your classpath

  dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'

    }
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
0

Must have :

compileSdkVersion 23

&

 dependencies {
            classpath 'com.android.tools.build:gradle:1.5.0'

        }
Suhas Bachewar
  • 1,230
  • 7
  • 21