error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCom

来源:互联网 发布:ubuntu查看显卡状态 编辑:程序博客网 时间:2024/04/28 19:16

    问题:新建andorid工程中文件styles.xml报错error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.  error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.


    原因:找不到 android-support-v4.jar
                                           android-support-v7-appcompat.jar


    解决方法1:为了版本兼容的,你新建项目时最低版本(Minimum Required SDK)选择4.0以上,就不会出现appcompat_v7包,AndroidBarActivity是支持库里的类可以兼容2.x版本 activity提供的actionbar只有在3.0以上才可以用


    解决方法2:添加连个库就行了
                                     库路径:sdk\extras\android\support\v7\appcompat\libs
                                     名字:
                                                 android-support-v4.jar
                                                 android-support-v7-appcompat.jar

0 0
原创粉丝点击