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 Build a Simple Android App with Java Creating the Screen Layout Getting to Know Our Tools

Patan Paul
Patan Paul
1,298 Points

Can't see live preview in Design Tab in Android Studio

So I'm getting started with Android Development and I have a little issue.

I can edit the Hello world text by accesing the XML file in the Text tab, but I cannot see anything "live" in the Design tab. Where I change the text from "Hello World!" to "Did you know?", I cannot see the text, neither a button or anything else, if I add them, in the Design tab.

I guess I fixed the problem by changing my SDK version to 27. btw if the SDK Version of your build is higher, then the SDK Android Studio is displaying at the moment, your design tab won't show any elements. I don't know if I expressed myself correctly, but I attached a few images, to show what I mean, in case anyone with the same problem will find his way to this thread. The solution is kinda hard to find, if you don't know what you are searching for.

https://picload.org/view/dldaipoi/1.jpg.html https://picload.org/view/dldaipow/2.jpg.html (I hope links are allowed)

(src: https://stackoverflow.com/questions/49292487/failed-to-find-style-coordinatorlayoutstyle-in-current-theme - there are a few answers some could try. they guess the problem is with the 28 SDK version)

on my version the error only occurs if i'm choosing that my app is backwards compatible, when I start a new project. i would like to know where the problem is, can somebody help? the error tells me, that it can't find the ressources for the used theme. if necessary, i can post it ofc.

greets

1 Answer

Try to change this line in your styles.xml :

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

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

Patan Paul
Patan Paul
1,298 Points

Thanks for the opinion, I solved it out myself anyways, using another method. Again, thanks anyway!

What difference does that make by the way? It solved my issue as well, I just wanted to know what it does to resolve this issue.