LinkedIn SDK init bad resultCode

你离开我真会死。 提交于 2019-12-04 18:50:19

Result code "2" indicated an error is occurring. You should be able to see more information about the problem from the errorInfo and errorDesc objects returned.

Try this way I got my solution with this process of creating SHA

try {
        PackageInfo info = context.getPackageManager().getPackageInfo(
                packageName, PackageManager.GET_SIGNATURES);
        for (Signature signature : info.signatures) {
            MessageDigest md = MessageDigest.getInstance("SHA");
            md.update(signature.toByteArray());

            // writtenToFile("FB_KEY_HASH.txt",
            // Base64.encodeToString(md.digest(),
            // Base64.DEFAULT).toString(), false);

            if (AppUtills.showLogs)
                Log.v(pageName,
                        "KeyHash:"
                                + Base64.encodeToString(md.digest(),
                                        Base64.DEFAULT));
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

I had the same issue. My problem was when generating the debug key I thought the password prompt was for me to password protect the debug.keystore file. Actually it is prompting you for the password that Android studio used when creating the file which is android. If you put in the wrong password the keytool -exportcert command returns no errors. However if you try keytool -list ~/.android/debug.keystore it will let you know if the password is wrong.

I got the same error while integrating linkedin in android app. This error is due to invalid hash key.Generate key hash either by development keystore aand release keystore.

Development Keystore Syntax : keytool -exportcert -keystore ~/.android/debug.keystore -alias androiddebugkey | openssl sha1 -binary | openssl base64

It will prompt for password : give password android you will get correct keyhash.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!