Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当获取用户信息Facebook SDK时,已签名的Android应用程序已崩溃_Android_Crash_Facebook Login - Fatal编程技术网

当获取用户信息Facebook SDK时,已签名的Android应用程序已崩溃

当获取用户信息Facebook SDK时,已签名的Android应用程序已崩溃,android,crash,facebook-login,Android,Crash,Facebook Login,我刚刚创建了一个应用程序,它使用facebook sdk 3.0获取用户信息。这是代码: private void getMe() { Session session = Session.getActiveSession(); CanBanNhanhAppActivity._fbtoken = session.getAccessToken(); // make request to the /me API Request request = Request.new

我刚刚创建了一个应用程序,它使用facebook sdk 3.0获取用户信息。这是代码:

private void getMe()
{
    Session session = Session.getActiveSession();
    CanBanNhanhAppActivity._fbtoken = session.getAccessToken();
    // make request to the /me API
    Request request = Request.newMeRequest(session,
            new Request.GraphUserCallback() {
        // callback after Graph API response with user object
        @Override
        public void onCompleted(GraphUser user,
                Response response) {
            //ShowDialog(response.getError().toString());
            // TODO Auto-generated method stub
        }
    });

    Request.executeBatchAsync(request);
}
早期,代码可以工作(通过apk安装,也可以从eclipse部署)。 但是,最近,从apk安装的应用程序在调用
Request.executeBatchAsync(Request)时崩溃。尽管如此,通过eclipse构建的应用程序仍然可以工作。我不知道为什么。我无法调试,因为只有apk安装的应用程序崩溃。
这是许可证:

private static final List PERMISSIONS=Arrays.asList(“读取流”、“电子邮件”、“用户照片”)


p/s:我在developer.facebook中的应用程序上添加了调试和释放哈希键。

这是您的facebook密钥哈希问题。请从系统生成您的密钥哈希,并将该密钥哈希粘贴到您的facebook应用程序,然后使用appid。 使用以下步骤生成keyhash,然后转到facebook应用程序仪表板,编辑应用程序并将hashkey添加到应用程序

 In order to generate key hash you need to follow some easy steps.
1) Download Openssl from: http://code.google.com/p/openssl-for-windows/downloads/list
2) Make a openssl folder in C drive
3) Extract Zip files into openssl folder
4) Copy the File debug.keystore from .android folder in my case (C:\Users\SYSTEM.android) and paste into JDK bin Folder in my case (C:\Program Files\Java\jdk1.6.0_05\bin)
5) Open command prompt and give the path of JDK Bin folder in my case (C:\Program Files\Java\jdk1.6.0_05\bin).
6) Copy the code and hit enter keytool -exportcert -alias androiddebugkey -keystore debug.keystore > c:\openssl\bin\debug.txt
7) Now you need to enter password, Password = android.
8) See in openssl Bin folder you will get a file with the name of debug.txt
9) Now either you can restart command prompt or work with existing command prompt
10) comes to C drive and give the path of openssl Bin folder
11) copy the following code and paste openssl sha1 -binary debug.txt > debug_sha.txt
12) you will get debug_sha.txt in openssl bin folder
13) Again copy following code and paste openssl base64 -in debug_sha.txt > debug_base64.txt
14) you will get debug_base64.txt in openssl bin folder
15) open debug_base64.txt file Here is your Key hash.
请参阅此博客

编辑:


事实上,发生此问题的原因是您的apk签名过程不同。两个散列键不同,请尝试使用相同的散列键对apk进行签名。当您对apk进行签名时,请使用现有密钥库,并且其密码很可能是android。请尝试此步骤,这将起作用

即使从apk安装,您仍然可以看到logcat错误,因此获取错误并将其粘贴到此处。请给出logcat错误消息我在下面发布了logcat。谢谢你的帮助!检查编辑的答案我想我添加了调试密钥和发布密钥。要获取发布密钥,我创建了myrelease.keystore,并设置了密码。你认为,我应该只使用debug.keystore对应用程序进行签名??