最新版ADT(Build: v22.6.2)总是引用appcompat_v7的问题
昨天在ADT Manager里更新了一些组件,结果ADT不支持。索性直接下载了最新的ADT。但是发现无论创建什么类型的应用(无论支持的最低API是多少,或者是不是用模板),都会在创建应用的同时创建一个appcompat_v7的类库,然后用创建的应用引用它。
这个类库是用来向以前基本兼容的,比如让3.0之前的版本支持ActionBar。但Google为什么每次都要引用这个呢,令人费解,现在2.x的份额已经降到很低了。难道是为了推广自家的appcompat类库,让用户摆脱ActionBarSherlock吗。
在StackOverflow上看到有人问同样的问题,有人给出了回答(戳这里),这里整理一下:
Step #1: Right-click over the project name in the Package Explorer, and choose Properties. Click on Android in the list of property categories on the left, and scroll down on the right to the bottom。
步骤一:右击项目,选择Properties,选择左侧的Android。
Step #2: In the list of attached library projects that you will now see in the properties dialog, you may see an entry akin to the "appcompat_v7_6" one that you see in the above screenshot. Your last digit will differ, and it may be that yours has a red X instead of a green checkmark. Regardless, if there is an entry for "appcompat_v7_NNN" in the list, click on it, then click the Remove button to the right of the list. Then, click the OK button to close up the dialog.
步骤二:在Library窗口,选中 "appcompat_v7_NNN",选择Remove,然后点OK。
Step #3: In res/values/styles.xml, change the parent of AppBaseTheme from Theme.AppCompat.Light to @android:style/Theme.Light. In res/values-v11/styles.xml, change the parent of AppBaseTheme from Theme.AppCompat.Light to @android:style/Theme.Holo.Light. In rest/values-v14/styles.xml change the parent of AppBaseTheme from Theme.AppCompat.Light.DarkActionBar to @android:style/Theme.Holo.Light.DarkActionBar. Note that these values assume that you chose the default "Light theme with dark action bar" when you created the project -- you will need to make slight adjustments to those instructions for anything else.、
步骤三:在res/values/styles.xml中,把AppBaseTheme的parent从Theme.AppCompat.Light 改成 @android:style/Theme.Light。
res/values-v11/styles.xml中, change the parent of AppBaseTheme from Theme.AppCompat.Light to @android:style/Theme.Holo.Light.
rest/values-v14/styles.xml change the parent of AppBaseTheme from Theme.AppCompat.Light.DarkActionBar to @android:style/Theme.Holo.Light.DarkActionBar.
(把各个版本的style都从AppCompat改成系统默认的Theme,但是这样3.0之前的版本就不支持ActionBar了。)
Step #4: In res/menu/main/xml, remove xmlns:app="http://schemas.android.com/apk/res-auto" from the root <menu> element and the app:showAsAction="never" attribute from the <item> element.
步骤四:删掉res/menu/main/xml中的xmlns:app="http://schemas.android.com/apk/res-auto"和app:showAsAction="never"元素。
Step #5: In your activity (e.g., MainActivity), change the parent class of the activity to something other than ActionBarActivity -- FragmentActivity would be a good choice, to minimize the number of other changes you will have to make immediately. Also, clean your imports (e.g., Ctrl-Shift-O).
步骤五:在activity中,比如MainActivity,把继承的ActionBarActivity改成其他的东西——比如FragmentActivity,然后Ctrl-Shift-O清除一些导入的包。
At this point, other than perhaps cleaning your project (Project > Clean from the main menu), the appcompat stuff should be ripped out of a project created using the "BlankActivity" template and with a "Navigation Type" of "None". Other templates, or navigation options on the "BlankActivity" template, will probably require more work.
这个时候除了Project>clean,appcompat应该差不多从你的项目里移除了。
最新版ADT(Build: v22.6.2)总是引用appcompat_v7的问题的更多相关文章
- 关于新版ADT创建项目时出现appcompat_v7的问题
做Android开发的朋友最近会发现,更新ADT至22.6.0版本之后,创建新的安装项目,会出现appcompat_v7的内容.并且是创建一个新的内容就会出现.这到底是怎么回事呢?原来appcompa ...
- 新版ADT出现appcompat_v7的问题
问题 更新ADT至22.6.0版本号之后,创建新的安装项目,会出现appcompat_v7的内容.而且是创建一个新的内容就会出现. 事实上appcompat_v7是Google自己的一个兼容包.一个支 ...
- win10环境下jdk1.8+Android Developer Tools Build: v22.3.0-887826的问题
最进换了新电脑,配置开发环境,最新的android studio 要求jdk1.8,所以想都没想就下载1.8. 之后为了一个原来的老项目,得使用adt,遂装之,遇到一下问题 1.ADT新建项目src下 ...
- 新版ADT创建项目时出现appcompat_v7的问题
做Android开发的朋友最近会发现,更新ADT至22.6.0版本之后,创建新的安装项目,会出现appcompat_v7的内容.并且是创建一个新的内容就会出现.这到底是怎么回事呢?原来appcompa ...
- Android adt v22.6.2 自动创建 appcompat_v7 解决方法,最低版本2.2也不会出现
Android 开发工具升级到22.6.2在创建工程时只要选择的最低版本低于4.0,就会自动生成一个项目appcompat_v7,没创建一个新的项目都会自动创建,很是烦恼... 之前在网上也找过方法, ...
- 使用 ng build 构建后资源地址引用错误的问题
最近使用 Angular 做项目的时候,通过 ng build 打包后的资源地址都带有 localhost:4200,百思不得其解,以为是打包的问题. 最后在 index.html 的文件中发现有一个 ...
- Windows环境下教你用Eclipse ADT 插件生成.h/.so文件,Java下调用JNI,轻松学习JNI
准备工作:Eclipse ADT IDE 开发工具,NDK .Java 环境,博主的配置是:Windows x86 , ADT Build: v22.3.0-887826 , JAVA 1.7, ND ...
- Android海康监控视频调用demo
一. 开发环境 1. 操作系统:windows7(X64) 2. 开发工具:eclipse adt Build: v22.2.1-833290 JDK7 android SDK 3. 客户端设备版本: ...
- Android Studio vs. Eclipse ADT Comparison
Android Studio 是一个新的基于 IntelliJ IDEA Android 的安卓开发环境,它对 Eclipse ADT 进行了改进并新增了功能. Feature Android Stu ...
随机推荐
- DICOM医学图像处理:Deconstructed PACS之Orthanc,Modification & Anonymization
背景: 上篇博文为引子,介绍了一款神奇的开源PACS系统——Orthanc.本篇开始解读官方Cookbook中的相关内容,对于简单的浏览.访问和上传请阅读前篇博文.在常规的PACS系统中还未出现对于D ...
- Lazarus安装使用
Lazarus安装使用 最后还是安装了Lazarus: 安装之后,新建了项目,还引入了Unit,就可以跑了: 学习:http://tieba.baidu.com/p/3164001113 progra ...
- 转:国内外著名开源b2c电子商务系统比较包括asp.net和php
from: http://longdick.iteye.com/blog/1122879 国内外著名开源b2c电子商务系统比较包括asp.net和php 博客分类: 电子商务 国内外著名开源b2c ...
- android:使用gallery和imageSwitch制作可左右循环滑动的图片浏览器
为了使图片浏览器左右无限循环滑动 我们要自己定义gallery的adapter 假设要想自己定义adapter首先要了解这几个方法 @Override public int getCount() { ...
- ollydbg快速定位方便调试
在ollydbg调试的时候,会看到大量的汇编代码(远多于源代码),代码中有大量的函数嵌套调用,调试起来周期很长,难度比较大. 所以我们希望能快速定位到代码,以下是快速定位的四种方法: 1.Goto命令 ...
- 前端UI框架整理
JQuery Jquery官网:http://jquery.com/ jQuery是一个快速,小巧,且功能丰富的JavaScript库. Jquery-1.11.3.min.js 压缩版:http:/ ...
- dsp-asic-fpga
DSP是在模拟信号变换成数字信号以后进行高速实时处理的专用处理器,它采用的是哈佛设计,即数据总线和地址总线分开,使程序和数据分别存储在两个分开的空间,允许取指令和执行指令完全重叠,也就是说在执行上一条 ...
- Java8新特性(一)概览
最近看了好几段Java代码和以往的风格很不一样,都有点不太适应了,后来一查原来是Java8的新特性. 为了保持对技术的敏感性(面试...),这里我们一起来学习下Java8的新特性. 如果从技术角度来看 ...
- 用JS写九九乘法表
本来JS部分觉得就不是很好,结果经过一个寒假,在家的日子过的太舒适,基本把学的都快忘干净了,今天老师一说九九乘法表,除了脑子里浮现出要满足的条件,其他的都不记得了,赶快整理了一下: <scrip ...
- linux 中添加自己的库路径的方法 cannot open shared object file: No such file or directory
本文转自:http://blog.csdn.net/maotianwang/article/details/44619197 库文档在连接(静态库和共享库)和运行(仅限于使用共享库的程式)时被使用,其 ...