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 Editing a Layout File

Ruslan T
Ruslan T
1,706 Points

Failed to load AppCompat ActionBar with unknown error.

I'm trying to open the design tab, but it shows nothing, there is no "Hello World!" message anywhere, and it's just an empty screen.

It also shows this error:

Failed to load AppCompat ActionBar with unknown error.

here is my xml when I created the file.

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".FunActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>

can anyone help?

I got the same error!

1 Answer

This worked for me. Modify /res/values/styles.xml from:

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

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

Anuj Bhusari
Anuj Bhusari
12,240 Points

Do you know why does this work?