Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 1.2.1.1 layout preview problems

After updating to Android Studio 1.2.1.1, I created a new fresh blank project and created a layout.xml

Shortly after creation, I decided to look at the preview. I went in and I saw this:

The following classes could not be instantiated: - android.support.v7.internal.widget.ActionBarOverlayLayout (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.NoClassDefFoundError: Could not initialize class android.support.v7.internal.widget.ActionBarOverlayLayout   at java.lang.reflect.Constructor.newInstance(Constructor.java:408)   at android.view.LayoutInflater.inflate(LayoutInflater.java:482)   at android.view.LayoutInflater.inflate(LayoutInflater.java:414)   at com.android.layoutlib.bridge.bars.BridgeActionBar.(BridgeActionBar.java:84)   at com.android.layoutlib.bridge.bars.AppCompatActionBar.(AppCompatActionBar.java:56) Copy stack to clipboard

I have never seen it before and I had never encountered it before. Anyone have any idea how to fix this?

EDIT:

Someone Recommended me this location but it didn't work. It only brought me NullPointerExceptions.

I tried rebuilding the project but it didn't work.

like image 512
Fish Avatar asked May 27 '15 23:05

Fish


1 Answers

Seems to be a bug. Workaround is to inherit from the Base theme in your styles.xml:

<style name="AppTheme" parent="Base.Theme.AppCompat.Light"/>
like image 169
tachyonflux Avatar answered Sep 28 '22 13:09

tachyonflux