your project contains error(s), please fix them before running your application
控制台输出的异常是:
Android\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
Android\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
eclipse-workspace\appcompat_v7\res\values-v21\styles_base.xml:146: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.
eclipse-workspace\appcompat_v7\res\values-v21\styles_base.xml:69: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.
等等······在此不再一一罗列
解决方法:
对于values这个地方产生的no resource found问题,说明是没有v7下的资源,只要添加这个资源就行。
点击eclipse导航栏上面的project-->properties-->android 这个界面底下的library里面有个add按钮,点击添加这个资源。
然后再右击项目,选择import,然后找到下载的sdk的路径,找到这个sdk\extras\android\support\v7\appcompat,选中后添加就行。
再打开sdk Manager,查看extras中的library版本并记住,然后右击android-support-v7-appcompat工程-->properties-->android,在project build target中选择与刚才library对应的版本,然后apply。
最后clean以下项目就行了,哈哈
记住,如果新建项目要引用这个项目,那么这个新建项的project build target中的版本也必须和上面项目的保持一致,不然也会报错。clean项目。
这样所有的错误都不复存在,哈哈哈哈