Tek Eye Logo

Tek Eye

Rendering Problems with WindowDecorActionBar

This brief article describes the android.support.v7.app.WindowDecorActionBar error that is displayed when an App's layout is viewed in Studio. A null pointer exception occurs when Android Studio attempts to show a layout in design mode after a project has been built.

Rendering Problems Error with WindowDecorActionBar

The error is easy to reproduce. Simply create a new project with an empty Activity. Run the project. Open the Activity's layout in Design view and the error is shown:

Rendering Problems
The following classes could not be displayed:

    - android.support.v7.app.WindowDecorActionBar (Open Class, Show Excpetion, Clear Cache)
    ... etc.

The cause is a null pointer exception:

    at android.support.v7.app.WindowDecorActionBar.getDecorToolbar(WindowDecorActionBar.java:240)
    at android.support.v7.app.WindowDecorActionBar.init(WindowDecorActionBar.java:197)
    at android.support.v7.app.WindowDecorActionBar.<init>(WindowDecorActionBar.java:189)
    ... etc.

Strangely clicking the Clear Cache link on the displayed error resolves it. As does opening and closing the project or Studio.

Another workaround from Stack Overflow is to edit styles.xml in the values folder. Add Base. in front of Theme.AppCompat.Light.DarkActionBar, i.e.:




Author:  Published:  

markdown CMS Small Logo Icon ↓markdown↓ CMS is fast and simple. Build websites quickly and publish easily. For beginner to expert.

Articles on:

Android, HTML, ↓markdown↓ CMS, VPS, Computing, Computer History