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

本文将解决使用Android Studio创建第一个工程时遇到的渲染问题,错误提示为无法实例化指定类。通过检查并修改style.xml文件中的代码,解决了在主题设置中出现的ClassNotFoundException错误。

最近下了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>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值