就是遇到这种报错时该怎么办:
Can’t Find Theme.AppCompat.Light for New Android

ActionBar Support Error retrieving parent for item: No resource found that matches the given name Theme.AppCompat.Light

结论很明确,v7支持包是带资源的库
Adding libraries with resources,文末给出了谷歌官方的解释。

所以你需要的是那几个jar包在各自的地方,并且 project build 和 java build 都配置正确,而不是在纠结mainfest里的版本问题。

首先,你的工程文件应该长下图这个样子,appcompat_v7工程是必须的,在创建时由eclipse在workspace下生成。如果不小心短路删除了,要再创建一个工程,或者有备份可通过File->import       ->General->exsiting project 导入

必须注意:appcompat_v7和sdk下的appcompat中的文件夹是不完全一致的,至于为什么,俺也不清楚,有人知道么?
然后,在下图中有四个跟lib有关的地方

——  1 和 3、4是互补的,4中的jar包会自动build到1中;同时,eclipse会自动识别出不是android SDK私有的jar包,并放入3中。
——  而  2   中的jar包来自外部的project
这里就要提到 android 工程里的两个 build 配置路径: project build  和 java  build 
—— project build 里指定好project,然后就能将该工程中的jar包导入到上图的2中


最后,结论很明确,你需要的是那几个jar包在各自的地方,并且 project build  和 java  build 都配置正确,而不是在纠结mainfest里的版本问题。
忽略掉httpmine后,就是你们要的正确的样子。然后alt+enter配置吧
楼下是谷歌正统的说法
https://developer.android.com/tools/support-library/setup.html#add-library
什么,你翻不了墙?怪我咯?

Adding libraries with resources

To add a Support Library with resources (such as v7 appcompat for action bar) to your application project:

Using Eclipse

Create a library project based on the support library code:

  1. Make sure you have downloaded the Android Support Library using the SDK Manager.
  2. Create a library project and ensure the required JAR files are included in the project’s build path:
    1. Select File > Import.
    2. Select Existing Android Code Into Workspace and click Next.
    3. Browse to the SDK installation directory and then to the Support Library folder. For example, if you are adding theappcompat project, browse to /extras/android/support/v7/appcompat/.
    4. Click Finish to import the project. For the v7 appcompat project, you should now see a new project titled android-support-v7-appcompat.
    5. In the new library project, expand the libs/ folder, right-click each .jar file and select Build Path > Add to Build Path. For example, when creating the the v7 appcompat project, add both the android-support-v4.jar and android-support-v7-appcompat.jar files to the build path.
    6. Right-click the library project folder and select Build Path > Configure Build Path.
    7. In the Order and Export tab, check the .jar files you just added to the build path, so they are available to projects that depend on this library project. For example, the appcompat project requires you to export both the android-support-v4.jar and android-support-v7-appcompat.jar files.
    8. Uncheck Android Dependencies.
    9. Click OK to complete the changes.

You now have a library project for your selected Support Library that you can use with one or more application projects.

Add the library to your application project:

  1. In the Project Explorer, right-click your project and select Properties.
  2. In the category panel on the left side of the dialog, select Android.
  3. In the Library pane, click the Add button.
  4. Select the library project and click OK. For example, the appcompat project should be listed as android-support-v7-appcompat.
  5. In the properties window, click OK.

Note: If you are using the android-support-v7-mediarouter support library, you should note that it depends on theandroid-support-v7-appcompat library. In order for the v7 mediarouter library to compile, you must import both library projects into your development workspace. Then follow the procedure above to add the v7 appcompat project as a library to the v7 mediarouter library project.


https://developer.android.com/tools/support-library/setup.html#add-library>   转载请注明。
来源: http://write.blog.csdn.net/mdeditor#!postId=45824833

更多相关文章

  1. 阅读《Android(安卓)从入门到精通》(23)——列表视图
  2. android点击文本框之外的地方隐藏键盘
  3. 阅读《Android(安卓)从入门到精通》(17)——进度条
  4. cocos2d-x环境搭建 for eclipse
  5. Android:在Eclipse下开发android应用产生的问题及解决方法
  6. Android(安卓)App状态栏动态显示隐藏
  7. Android(安卓)程序中哪个 Activity 最先运行
  8. 【笔记】试玩 cocos2d-x-3.0beta on android
  9. android VideoView播放工程raw下的视频+全屏问题

随机推荐

  1. 如何为网站制作Sitemap
  2. 做SEO前必学的网站建设基础知识
  3. html表单、元素的来源及csss外部样式和上
  4. 单页面是什么呢?单页面怎么优化
  5. 怎么发帖可以让搜索引擎(百度)尽快收录?
  6. URL如何优化?网站url链接形式这样去做,利于
  7. 上下文选择器
  8. CSS 盒子模型理解
  9. 自定义一个kaniko镜像
  10. CSS 常用伪类简介