AndroidStudio3.1.4版本,新建項目佈局文件預覽爲空白,並出現“Failed to instantiate one or more classes”提示.
解決方法如下:
進入 res–values–styles.xml文件,將AppTheme – parent的值,在前面加上Base. 即可。
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>