我在尝试创建新的 Android 应用程序项目时遇到了这个奇怪的问题。每当我创建一个新的 Android 应用程序项目时,我都会在上面看到一个红色感叹号。我还在控制台中收到一些我不知道的错误。
[2015-07-20 07:45:09 - ExampleProject] Found 2 versions of android-support-v4.jar in the dependency list,
[2015-07-20 07:45:09 - ExampleProject] but not all the versions are identical (check is based on SHA-1 only at this time).
[2015-07-20 07:45:09 - ExampleProject] All versions of the libraries must be the same at this time.
[2015-07-20 07:45:09 - ExampleProject] Versions found are:
[2015-07-20 07:45:09 - ExampleProject] Path: C:\Users\Umair Ahmed\workspace\ExampleProject\libs\android-support-v4.jar
[2015-07-20 07:45:09 - ExampleProject] Length: 1184670
[2015-07-20 07:45:09 - ExampleProject] SHA-1: fde22d8d2ef6363324a3d79a1dd16c8645c25564
[2015-07-20 07:45:09 - ExampleProject] Path: C:\Users\Umair Ahmed\workspace\appcompat_v7\libs\android-support-v4.jar
[2015-07-20 07:45:09 - ExampleProject] Length: 1184450
[2015-07-20 07:45:09 - ExampleProject] SHA-1: e19387dc3b060af32f5401f84fbe246635256955
[2015-07-20 07:45:09 - ExampleProject] Jar mismatch! Fix your dependencies
[2015-07-20 07:45:09 - ExampleProject] C:\Users\Umair
过去,我曾经通过删除带有红叉的 Android 依赖项文件夹来修复它。但现在它不起作用,因为那时我在主 src 文件夹中得到一个红叉,并且会出现旧的(R 无法解析为变量)错误。 作为 Android 的初学者,我不知道如何处理这个东西。它只在一天发生,并在 1-2 周后自行发生。任何帮助将不胜感激。到目前为止,其他答案都没有奏效,过去有效的现在无效。谢谢。
最佳答案
由于您仍在使用 Eclipse,新的 AppCompat v7 与 Android Support v4 一起提供。
删除您自己的ExampleProject\libs\android-support-v4.jar
,清理项目并构建。
关于android - 构建 Android 应用程序项目时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31519791/