Saturday, 28 September 2013

Android Exception NameNotFoundException

Android Exception NameNotFoundException

I don't understand why happens this exception.
In my Main activity, in the method onCreate I have this code at first:
try {
PackageInfo info =
this.getPackageManager().getPackageInfo("com.mypacket",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.e("Hash", Base64.encodeToString(md.digest(),
Base64.DEFAULT));
}
} catch (NameNotFoundException e) {
Log.e("Hash", "Error: NameNotFoundException");
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
Log.e("Hash", "Error: NoSuchAlgorithmException");
}
The exception is NameNotFoundException, I want to solve it because I think
it causes problem with the Facebook SDK.
Thank you all.

No comments:

Post a Comment