简体   繁体   English

删除v7 appcompat文件夹

[英]Remove v7 appcompat folder

After Updating my adt plugin. 更新我的adt插件后。 When ever I create any project "appcompat v7" folder is created . 什么时候我创建任何项目“appcompat v7”文件夹被创建。 I used this dependency. 我使用了这种依赖。 But problem is suppose I have 5 projects then. 但问题是假设我有5个项目。 it makes 5 different folders what to do? 它使5个不同的文件夹做什么?

This is part of the ADT/SDK update and it is not a bad thing to happen. 这是ADT / SDK更新的一部分,并不是一件坏事。 It ensures that your app has full support of the ActionBarActivity that was implemented in API 14+. 它确保您的应用程序完全支持在API 14+中实现的ActionBarActivity。 It will get created each time by default, but with a little work you can keep your files down. 默认情况下,每次都会创建它,但只需稍加工作就可以保存文件。 I simply have a single appcompat_v7, whenever I create a project, let's call it SampleApplication, appcompat_v7_2 is created. 我只需要一个appcompat_v7,每当我创建一个项目时,让我们称之为SampleApplication,创建appcompat_v7_2。

  • How to re-reference your library - 如何重新引用你的图书馆 -

Right click on "SampleApplication" 右键单击“SampleApplication”

Go to "Properties" 转到“属性”

Click "Android" 点击“Android”

Scroll to the bottom's "Library" section 滚动到底部的“图书馆”部分

Click "..\\appcompat_v7" 点击“.. \\ appcompat_v7”

Click "Remove" 点击“删除”

Click "Add" 点击“添加”

Click on "appcompat_v7" 点击“appcompat_v7”

Click "Apply"` 单击“应用”`

Now you have referenced your preexisting library. 现在您已经引用了预先存在的库。 You now need to delete your old "extra" duplicate appcompat_v7_2 library. 您现在需要删除旧的“额外”重复appcompat_v7_2库。 I do this as follows: 我这样做如下:

  • Deleting duplicated copy - 删除重复的副本 -

Right click on "appcompat_v7_2" in the Package Explorer of your workspace 右键单击工作区的Package Explorer中的“appcompat_v7_2”

Click "Delete" 点击“删除”

if(Delete Options contains checkbox to delete from physical workspace){
    Check the checkbox to delete the physical folder from your hard drive and press OK;
}
else{
    Go to your physical workspace (In Windows, something like C:......\workspace);
    Find "appcompat_v7_2";
    Right click on "appcompat_v7_2" in your physical workspace;
    Click "Delete";
}
Restart Eclipse;

After referencing to your pre-existing library, you may get an error with your application that reads in the console as Found 2 versions of android-support-v4.jar in the dependency list,... To solve that problem, go into your applications libs folder in your workspace and delete the android-support-v4.jar . 在引用您预先存在的库之后,您可能会在应用程序中收到错误,该应用程序在控制台中读取Found 2 versions of android-support-v4.jar in the dependency list,...要解决该问题,请进入您的您的工作区中的应用程序libs文件夹并删除android-support-v4.jar

It is not ideal as it requires a bit of setup for each application. 它并不理想,因为它需要为每个应用程序进行一些设置。 But it works. 但它的确有效。 You can also uncheck "Create Activity" when you are creating your application project and it won't add the library (but also, obviously, won't include your main activity). 您还可以在创建应用程序项目时取消选中“创建活动”,它不会添加库(但显然也不包括您的主要活动)。

As another note, apparently for some people it doesn't include the library if your minimum sdk version for your application is 11+. 另外注意,显然对于某些人来说,如果您的应用程序的最小sdk版本是11+,则它不包括库。 For me, however, it always includes it, so this is my way around it. 然而,对我来说,它总是包含它,所以这是我的方式。

IMPORTANT FIND - PLEASE READ 重要信息 - 请仔细阅读

So I decided to start a new workspace for a library project I am working on and came across something interesting. 所以我决定为我正在研究的图书馆项目开始一个新的工作区,并遇到了一些有趣的事情。 I imported my appcompat_v7 into my new workspace from my old workspace, making sure to click on Copy projects into workspace. 我从旧工作区将appcompat_v7导入新工作区,确保单击“将项目复制到工作区”。 Now it doesn't add appcompat_v7 every time that I add a new project into my new workspace. 现在,每次我将新项目添加到新工作区时,它都不会添加appcompat_v7。 Led me to realizing a possible fix: 引导我实现可能的修复:

try moving appcompat_v7 from your workspace folder to another folder, and the importing it back into your workspace making sure to click Copy projects into workspace . 尝试将appcompat_v7从工作区文件夹移动到另一个文件夹,然后将其导回到工作区,确保单击“将项目复制到工作区”

Not sure if it was just a glitch or something, but it worked twice when I retested it! 不确定这只是一个小故障还是什么,但是当我重新测试它时它工作了两次!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM