您的位置:首页 > 移动开发 > Android开发

android studio创建一个工程时候报错

2015-06-12 16:03 543 查看
最近下了android studio,创建第一工程时候就报错(如下):

Rendering Problems 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.ClassNotFoundException: android.support.v4.view.ViewPropertyAnimatorListener Copy stack to clipboard

从上面信息感觉是库文件缺少,最后弄了很久,才明白,其实问题很简单:在你工程文件style.xml中的代码有问题:

<!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
    </style>


应该在Theme前面加上Base.

<!-- Base application theme. -->
    <style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
    </style>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: