java.lang.NoClassDefFoundError的:android.security.MessageDigest [英] java.lang.NoClassDefFoundError: android.security.MessageDigest

查看:122
本文介绍了java.lang.NoClassDefFoundError的:android.security.MessageDigest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序使用 MessageDigest.getInstance(SHA-1)来获得SHA1,它可以在Android 2.3的成功运行,但它不能运行安卓4.0,它会显示以下异常:

In my application I use MessageDigest.getInstance("SHA-1") to get SHA1, it can run successfully in android 2.3, but it can't run in android 4.0 and it will show the below exception:

FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: android.security.MessageDigest
 at com.screenshare.email.Utility.getConsistentDeviceId(Utility.java:597)
 at com.screenshare.exchange.SyncManager.getDeviceIdInternal(SyncManager.java:1079)
 at com.screenshare.exchange.SyncManager.getDeviceId(SyncManager.java:1045)
 at com.screenshare.exchange.SyncManager.onCreate(SyncManager.java:1813)
 at android.app.ActivityThread.handleCreateService(ActivityThread.java:2253)
 at android.app.ActivityThread.access$1600(ActivityThread.java:123)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loop(Looper.java:137)
 at android.app.ActivityThread.main(ActivityThread.java:4424)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:511)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
 at dalvik.system.NativeStart.main(Native Method) 

谁能解释一下这个案子?

Who can explain this case?

推荐答案

从<一个href="http://productforums.google.com/forum/#!category-topic/maps/google-maps-for-mobile/KinrGn9DcIE">reading围绕googlegroups 这听起来像 android.security.MessageDigest 辗转于蜂窝。不幸的是,我还没有找到这样的Andr​​oid开发者文档中的证据。

From reading around googlegroups it sounds like android.security.MessageDigest was removed in Honeycomb. Unfortunately I am yet to find evidence of this in the Android developer documentation.

尝试使用<一个href="http://developer.android.com/reference/java/security/MessageDigest.html"><$c$c>java.security.MessageDigest代替。

Try using java.security.MessageDigest instead.

这篇关于java.lang.NoClassDefFoundError的:android.security.MessageDigest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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