gpt4 book ai didi

java - 删除 v7 appcompat 文件夹

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:55:26 25 4
gpt4 key购买 nike

更新我的 adt 插件后。每当我创建任何项目时,都会创建“appcompat v7”文件夹。我使用了这种依赖。但问题是假设我当时有 5 个项目。它使 5 个不同的文件夹做什么?

最佳答案

这是 ADT/SDK 更新的一部分,发生这种情况并不是一件坏事。它确保您的应用程序完全支持在 API 14+ 中实现的 ActionBarActivity。默认情况下每次都会创建它,但只需做一些工作,您就可以保存文件。我只有一个 appcompat_v7,每当我创建一个项目时,我们都将其称为 SampleApplication,并创建 appcompat_v7_2。

  • How to re-reference your library -

Right click on "SampleApplication"

Go to "Properties"

Click "Android"

Scroll to the bottom's "Library" section

Click "..\appcompat_v7"

Click "Remove"

Click "Add"

Click on "appcompat_v7"

Click "Apply"`

现在您已经引用了您先前存在的库。您现在需要删除旧的“额外”重复 appcompat_v7_2 库。我这样做如下:

  • Deleting duplicated copy -

Right click on "appcompat_v7_2" in the Package Explorer of your workspace

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;

引用您预先存在的库后,您的应用程序可能会出现错误,该错误在控制台中显示为 Found 2 versions of android-support-v4.jar in the dependency list,... 要解决该问题,请进入工作区中的应用程序 libs 文件夹并删除 android-support-v4.jar

它并不理想,因为它需要为每个应用程序进行一些设置。但它有效。您也可以在创建应用程序项目时取消选中“Create Activity”,这样它就不会添加库(但显然,也不会包括您的主要 Activity )。

另外请注意,如果您的应用程序的最低 sdk 版本为 11+,则显然对于某些人来说它不包含该库。然而,对我来说,它总是包含它,所以这是我解决它的方法。

重要发现 - 请阅读

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. Now it doesn't add appcompat_v7 every time that I add a new project into my new workspace. 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.

Not sure if it was just a glitch or something, but it worked twice when I retested it!

关于java - 删除 v7 appcompat 文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22542978/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com