Skip to main content
Added answer
Source Link
Vishal Puri
  • 843
  • 8
  • 15

In your Case, Problem is in your styles.xml, your base theme name is AppBaseTheme. Change it to AppTheme as you can see you have used AppTheme in your Mainfest file.

I have listed all the reasons that may cause class android.support.design.widget.FloatingActionButton. Please read the points carefully.

  1. FAB button is Design Library Cpmponent. Your Activity must extend AppCompatActivity instead of Activity.

  2. Your activity theme also should be appropriate Theme.AppCompat theme. Also FAB requires colorAccent. Make sure you have them inside your styles.xml.

    <!-- Base application theme. --> <style name="AppTheme" parent="Base.AppTheme"> <!-- Customize your theme here. --> </style> <style name="Base.AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android:colorAccent">@color/accent</item> </style> 
  3. Use app:backgroundTint="@color/your_color" instead of android:backgroundTint.

  4. Don't miss out on adding design library inside your project build.gradle file

     dependencies { compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' ... } 
  5. Update Support Library on SDK Manager in Extras > Android Support Repository and Android Support Library

Hope it solves your error.

I have listed all the reasons that may cause class android.support.design.widget.FloatingActionButton. Please read the points carefully.

  1. FAB button is Design Library Cpmponent. Your Activity must extend AppCompatActivity instead of Activity.

  2. Your activity theme also should be appropriate Theme.AppCompat theme. Also FAB requires colorAccent. Make sure you have them inside your styles.xml.

    <!-- Base application theme. --> <style name="AppTheme" parent="Base.AppTheme"> <!-- Customize your theme here. --> </style> <style name="Base.AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android:colorAccent">@color/accent</item> </style> 
  3. Use app:backgroundTint="@color/your_color" instead of android:backgroundTint.

  4. Don't miss out on adding design library inside your project build.gradle file

     dependencies { compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' ... } 
  5. Update Support Library on SDK Manager in Extras > Android Support Repository and Android Support Library

Hope it solves your error.

In your Case, Problem is in your styles.xml, your base theme name is AppBaseTheme. Change it to AppTheme as you can see you have used AppTheme in your Mainfest file.

I have listed all the reasons that may cause class android.support.design.widget.FloatingActionButton. Please read the points carefully.

  1. FAB button is Design Library Cpmponent. Your Activity must extend AppCompatActivity instead of Activity.

  2. Your activity theme also should be appropriate Theme.AppCompat theme. Also FAB requires colorAccent. Make sure you have them inside your styles.xml.

    <!-- Base application theme. --> <style name="AppTheme" parent="Base.AppTheme"> <!-- Customize your theme here. --> </style> <style name="Base.AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android:colorAccent">@color/accent</item> </style> 
  3. Use app:backgroundTint="@color/your_color" instead of android:backgroundTint.

  4. Don't miss out on adding design library inside your project build.gradle file

     dependencies { compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' ... } 
  5. Update Support Library on SDK Manager in Extras > Android Support Repository and Android Support Library

Hope it solves your error.

Added more points.
Source Link
Vishal Puri
  • 843
  • 8
  • 15

May be caused due to followingI have listed all the reasons that may cause class android.support.design.widget.FloatingActionButton. Please read the points carefully.

  1. Please change it into AppCompatActivity if you use Activity. Probably it becomes the error when itFAB button is Design Library Cpmponent. Your Activity must extend AppCompatActivity instead of Activity.

  2. Just change the project parentYour activity theme toalso should be appropriate Theme.AppCompat theme. Also FAB requires colorAccent. Make sure you have them inside your styles.xml.

    <!-- Base application theme. --> <style name="AppTheme" parent="Base.AppTheme"> <!-- Customize your theme here. --> </style> <style name="Base.AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android:colorAccent">@color/accent</item> </style> 
  3. Use app:backgroundTint="@color/your_color" instead of android:backgroundTint.

  4. Don't miss out on adding design library inside your project build.gradle file

     dependencies { compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' ... } 
  5. Update Support Library on SDK Manager in Extras > Android Support Repository and Android Support Library

edited:

Make sure you have them inside your styles.xml.

define colors in styles.xml

<item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> 

Hope it solves your problemerror.

May be caused due to following reasons.

  1. Please change it into AppCompatActivity if you use Activity. Probably it becomes the error when it is Activity.

  2. Just change the project parent theme to

     <style name="Base.AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 

edited:

Make sure you have them inside your styles.xml.

define colors in styles.xml

<item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> 

Hope it solves your problem.

I have listed all the reasons that may cause class android.support.design.widget.FloatingActionButton. Please read the points carefully.

  1. FAB button is Design Library Cpmponent. Your Activity must extend AppCompatActivity instead of Activity.

  2. Your activity theme also should be appropriate Theme.AppCompat theme. Also FAB requires colorAccent. Make sure you have them inside your styles.xml.

    <!-- Base application theme. --> <style name="AppTheme" parent="Base.AppTheme"> <!-- Customize your theme here. --> </style> <style name="Base.AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android:colorAccent">@color/accent</item> </style> 
  3. Use app:backgroundTint="@color/your_color" instead of android:backgroundTint.

  4. Don't miss out on adding design library inside your project build.gradle file

     dependencies { compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' ... } 
  5. Update Support Library on SDK Manager in Extras > Android Support Repository and Android Support Library

Hope it solves your error.

added 263 characters in body
Source Link
Vishal Puri
  • 843
  • 8
  • 15

May be caused due to following reasons.

  1. Please change it into AppCompatActivity if you use Activity. Probably it becomes the error when it is Activity.

  2. Just change the project parent theme to

     <style name="Base.AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 

edited:

Make sure you have them inside your styles.xml.

define colors in styles.xml

<item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> 

Hope it solves your problem.

May be caused due to following reasons.

  1. Please change it into AppCompatActivity if you use Activity. Probably it becomes the error when it is Activity.

  2. Just change the project parent theme to

     <style name="Base.AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 

Hope it solves your problem.

May be caused due to following reasons.

  1. Please change it into AppCompatActivity if you use Activity. Probably it becomes the error when it is Activity.

  2. Just change the project parent theme to

     <style name="Base.AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 

edited:

Make sure you have them inside your styles.xml.

define colors in styles.xml

<item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> 

Hope it solves your problem.

Source Link
Vishal Puri
  • 843
  • 8
  • 15
Loading