Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: FloatingActionButton could not be instantiated

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

like image 750
Ritu Raj Avatar asked Oct 31 '22 10:10

Ritu Raj


1 Answers

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'

    }
like image 154
IntelliJ Amiya Avatar answered Nov 15 '22 07:11

IntelliJ Amiya