在android中的依赖列表appcompat中找到了2个版本的android-support-v4.jar

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21450086/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:35:37  来源:igfitidea点击:

Found 2 versions of android-support-v4.jar in the dependency list appcompat in android

androidandroid-libraryandroid-appcompat

提问by John R

When I add appcompatproject as a library I get these errors:

当我将appcompat项目添加为库时,出现以下错误:

- found 2 versions of android-support-v4.jar in the dependency list appcompat in  android. 

- `aapt.exe` has stop working.

How to solve this?

如何解决这个问题?

回答by John R

Delete android-support-v4.jarfrom library and project. Then go in <sdk>/extras/android/support/samples/Support4Demos/and copy android-support-v4.jarand paste in libs folder of both.

android-support-v4.jar从库和项目中删除。然后进入<sdk>/extras/android/support/samples/Support4Demos/并复制android-support-v4.jar并粘贴到两者的 libs 文件夹中。

回答by user3243163

Generally you get this error when you add external library which already contains android-support-v4.jarfile.

通常,当您添加已经包含android-support-v4.jar文件的外部库时,您会收到此错误。

Here you can delete this android-support-v4.jarfile from your libs folder. This will solve your problem.

您可以在此处android-support-v4.jar从 libs 文件夹中删除此文件。这将解决您的问题。

回答by InnocentKiller

I too had same problem just few day's back and what i did is, just deleted the android-support-v4.jarfrom my project, and then i have added my library project jar by right clicking my project -> go to properties, select java Build Path and then select add external jarfrom the option and select android-support-v4.jarfrom your library project and then click on Order and exportand check mark android-support-v4.jarthat you have added from library project and then press Ok.

几天前我也遇到了同样的问题,我所做的是从我的项目中删除了android-support-v4.jar,然后我通过右键单击我的项目添加了我的库项目 jar -> 转到属性,选择java Build Path 然后从选项中选择添加外部 jar并从您的库项目中选择android-support-v4.jar然后单击Order and export并选中您从库项目中添加的android-support-v4.jar和然后按确定。

That's it. Enjoy Coding

就是这样。享受编码