在Android 4.4 SDK更新后,android-support-v7-appcombat jar不匹配和应用程序崩溃 [英] android-support-v7-appcombat jar mismatch and app crashing after Android 4.4 SDK update

查看:319
本文介绍了在Android 4.4 SDK更新后,android-support-v7-appcombat jar不匹配和应用程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中成功使用了android-support-v7-appcompat库,以支持旧设备中的操作栏。最近,我从SDK Manager下载了带有系统映像和SDK平台的Android 4.4(kitkat)更新。我还在清单文件中将targetSdkVersion添加到19。但我的项目显示错误为'android-support-v7-appcompat jar mismatch。修复你的权限。然后我使用构建路径菜单>添加外部jar,将/ extras / android / support / ....中的jar添加到项目中作为外部jar。现在项目中没有错误和android-support-v7-appcompat.jar& android-support0v4.jar文件在Referenced Libraries文件夹下显示两次,在libs文件夹下显示一次。该项目没有显示错误和运行,但在不同的活动中崩溃。

I have been successfully using android-support-v7-appcompat library for last few months in my app to support action bar in older devices. Recently I have downloaded the Android 4.4(kitkat) updates with system image and SDK platform from the SDK Manager. I also added targetSdkVersion to "19" in manifest file. But my project was showing error as 'android-support-v7-appcompat jar mismatch. Fix your dependaecies.' Then I added the jar from /extras/android/support/.... to the project as an external jar using build path menu > add external jar. Now there is no error in the project and android-support-v7-appcompat.jar & android-support0v4.jar file is showing twice under 'Referenced Libraries' folder and also once under 'libs' folder. The project is not showing error and running, but crashing in different activities.

以前我在工作场所导入了android-support-v7-appcombat库作为外部项目。我可以在该项目中看到错误。请建议我现在该怎么做。另外,Java构建路径中的android-support-v7-appcompat.jar umder Android Dependencies显示错误。

Previously I imported the android-support-v7-appcombat library as an external project in the workplace. I can see error in that project. Please suggest what should I do now. Also, android-support-v7-appcompat.jar umder Android Dependencies in Java Build Path showing error.

我看到的错误是:

Found 2 versions of android-support-v7-appcompat.jar in the dependency list,
but not all the versions are identical (check is based on SHA-1 only at this time).
All versions of the libraries must be the same at this time.

Versions found are:

Path: C:\<project hierarchy>\libs\android-support-v7-appcompat.jar

Path: C:\Users\....\sdk\extras\android\support\v7\appcompat\libs\android-support-v7-appcompat.jar

 Jar mismatch! Fix your dependencies

从不同的论坛获取想法后,我删除了所有的android-support-v7-appcompat来自不同地方的库,并在项目中再次导入android-v7支持库。它仍然显示错误。我是否还应该从buildpath和libs / private librariry /引用的库文件夹中删除android-support-v4库?

After getting idea from different forum, I removed all the android-support-v7-appcompat libraries from different places, and imported android-v7 support library again in the project. Still it's showing error. Should I also delete android-support-v4 libraries from buildpath and libs/private librariry/referenced library folders?

推荐答案

当在同一个项目中找到同一个库的多个不同实例或者使用的库时,会发生此错误它。解决此问题的一种非常简单的方法是在两个位置使用公共库。要这样做:

This error occurs when there are multiple and different instances of the same library are found in the same project, or libraries used by it. A very simple way to resolve this is use the common lib at both the places. To do so:

只需复制你的C:\Users .... \ AppData \ Local \ Android \ android-studio \ sdk\extras\android\support\v7\appcompat\libs\android-support-v7-appcompat.jar
并将其粘贴到您的libs文件夹中,用此替换旧文件夹。清理项目,它现在将编译..

编辑1:
基本上这个想法是你的使用相同的库,它应该是常见的jar或相同的jar。
在您的情况下,如果您使用appv7作为外部项目,请转到项目复制android-support-v4.jar的libs文件夹,并粘贴到android-support-v7-appcompat项目的库中。

Edit 1: Basically the idea is if you are using the same libraries, it shall be the common jar, or the same jar. In your case if you are using the appv7 as an external project, please go to libs folder of your project copy android-support-v4.jar, and paste into the libs of android-support-v7-appcompat project.

另外,请确保您使用的是其他外部罐子或支持库,它们应该是您正在使用的所有项目中的类似罐子。

Also, make sure if there are other external jars or support libraries used by you, they shall be the similar jars in all the projects you are using.

我希望它有所帮助!

这篇关于在Android 4.4 SDK更新后,android-support-v7-appcombat jar不匹配和应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆