LinkedIn SDK init bad resultCode

亡梦爱人 提交于 2019-12-09 23:56:58

问题


I'm following this tutorial and everything seems fine until the LinkedIn app goes back to my Activity (in onResultActivity). I get a resultCode of 2, which I can't figure out what it means. This resultCode is also not handled within the LinkedIn sdk code!

Has anyone come across this? Or had it run successfully?


回答1:


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.




回答2:


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();
    }



回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/29068428/linkedin-sdk-init-bad-resultcode

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