简体   繁体   中英

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.

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"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM