1

Wasn't getting this error before but after doing some Android Studio updates I see the following error in my XML:

enter image description here

The following classes could not be instantiated: - android.support.design.widget.FloatingActionButton (Open Class, Show Exception, Clear Cache) Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details android.content.res.Resources$NotFoundException: Unable to find resource ID #0x108003e    at android.content.res.Resources.getResourceName(Resources.java:2235)    at android.content.res.Resources.loadDrawableForCookie(Resources.java:2602)    at android.content.res.Resources.loadDrawable(Resources.java:2540)    at android.content.res.Resources.getDrawable(Resources.java:806)    at android.content.Context.getDrawable(Context.java:458)    at android.support.v4.content.ContextCompatApi21.getDrawable(ContextCompatApi21.java:26)    at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:321)

  

It all has to do with that floating action button but I don't get what went wrong. I tried changing the API version in the top right but for some reason the other ones just show a blank screen.

EDIT: my grade:

compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
Micro
  • 10,303
  • 14
  • 82
  • 120
  • Define "did some updates"? – JHH Mar 16 '16 at 19:47
  • It's a missing resource, likely an internal support library resource. Did you try simply resyncing and cleaning your project? – JHH Mar 16 '16 at 19:47
  • @JHH I did try rebuilding the project and invalidating caches and restart. By "updates" I mean the SDK manager did all of the auto updates. – Micro Mar 16 '16 at 20:03

1 Answers1

1

Floating action Button is part of the android.support.design library, make sure you have that in the gradle dependencies. If you have it, make sure to clean or rebuild the project.

dependencies{
    compile 'com.android.support:design:23.1.1'
}
Harjan
  • 533
  • 1
  • 6
  • 24
  • Sorry for not including this earlier, but I found that some people had problems with the 23.2.0 versions, like in this thread: http://stackoverflow.com/questions/35675855/android-studio-floatingactionbutton-error I am not entirely sure this is the problem, but it is worth a try, since some people are reporting crashes and bugs with the newest build – Harjan Mar 16 '16 at 22:48