Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Beysim ERYILMAZ
Beysim ERYILMAZ
1,600 Points

Android studio rendering problem

When i tried to change my android apps theme to Material light i get this problem below.What can i do guys?

Rendering Problems The following classes could not be instantiated: - android.support.design.widget.CoordinatorLayout (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 java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.   at android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34)   at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:178)   at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:172)   at java.lang.reflect.Constructor.newInstance(Constructor.java:526)   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)   at android.view.LayoutInflater.inflate(LayoutInflater.java:492)   at android.view.LayoutInflater.inflate(LayoutInflater.java:394) Copy stack to clipboard The surrounding layout (@layout/activity_main) did not actually include this layout. Remove tools:showIn=... from the root tag.

1 Answer

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

The error suggests, "You need to use a Theme.AppCompat theme (or descendant) with the design library.". I'm guessing you're trying to use a Material theme on a device that's not on a new enough version of Android.