【问题标题】:Facebook integration - Android - ParseFacebook 集成 - Android - 解析
【发布时间】:2015-06-08 09:55:02
【问题描述】:

我正在使用 ParseFacebookUtilsV4-1.9.2.jar 并且每次我在这行遇到错误时:

ParseFacebookUtils.initialize(this);

我面临的错误如下

... I/dalvikvm﹕ Could not find method com.facebook.FacebookSdk.sdkInitialize, referenced from method com.parse.FacebookAuthenticationProvider.<init>

... I/dalvikvm﹕ Could not find method com.facebook.login.LoginManager.getInstance, referenced from method com.parse.FacebookAuthenticationProvider.authenticateAsync

... W/dalvikvm﹕ VFY: unable to resolve static method 14412: Lcom/facebook/login/LoginManager;.getInstance ()Lcom/facebook/login/LoginManager;

... W/dalvikvm﹕ VFY: unable to resolve static method 14411: Lcom/facebook/FacebookSdk;.sdkInitialize (Landroid/content/Context;I)V

... W/dalvikvm﹕ VFY: unable to find class referenced in signature (Lcom/facebook/AccessToken;)

... I/dalvikvm﹕ Could not find method com.facebook.AccessToken.getUserId, referenced from method com.parse.FacebookAuthenticationProvider.getAuthData

... W/dalvikvm﹕ VFY: unable to resolve virtual method 14406: Lcom/facebook/AccessToken;.getUserId ()Ljava/lang/String;

... I/dalvikvm﹕ Could not find method com.facebook.CallbackManager.onActivityResult, referenced from method com.parse.FacebookAuthenticationProvider.onActivityResult

... W/dalvikvm﹕ VFY: unable to resolve interface method 14409: Lcom/facebook/CallbackManager;.onActivityResult (IILandroid/content/Intent;)Z

... I/dalvikvm﹕ Could not find method com.facebook.login.LoginManager.getInstance, referenced from method com.parse.FacebookAuthenticationProvider.restoreAuthentication

... W/dalvikvm﹕ VFY: unable to resolve static method 14412: Lcom/facebook/login/LoginManager;.getInstance ()Lcom/facebook/login/LoginManager;
... E/dalvikvm﹕ Could not find class 'com.facebook.AccessToken', referenced from method com.parse.FacebookAuthenticationProvider.restoreAuthentication

... W/dalvikvm﹕ VFY: unable to resolve new-instance 1749 (Lcom/facebook/AccessToken;) in Lcom/parse/FacebookAuthenticationProvider;
... I/dalvikvm﹕ Failed resolving Lcom/parse/FacebookAuthenticationProvider$1; interface 1753 'Lcom/facebook/FacebookCallback;'

... W/dalvikvm﹕ Link of class 'Lcom/parse/FacebookAuthenticationProvider$1;' failed

... W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41823700)

... E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: com.facebook.FacebookSdk
            at com.parse.FacebookAuthenticationProvider.<init>(FacebookAuthenticationProvider.java:68)
            at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:96)
            at com.parse.ParseFacebookUtils.initialize(ParseFacebookUtils.java:81)
        ...

谁能帮帮我?

【问题讨论】:

  • 你的问题解决了吗???

标签: java android facebook facebook-graph-api parse-platform


【解决方案1】:

注意:ParseFacebookUtils 需要 Facebook Android SDK v4.x.x from Parse docs

Could not find method com.facebook.FacebookSdk.sdkInitialize

这意味着您还需要 Facebook SDK。解析来自 Facebook SDK 的调用函数,该函数在您的项目中不存在。

【讨论】:

    【解决方案2】:

    你必须使用 FacebookSdk.sdkInitialize(getApplicationContext()); 之前 setContentView(R.layout.activity_main);正如documentation 所说。如果您需要完整的 facebook login example,请在此处查看。

    【讨论】:

    • 这段代码是否进入 FacebookSdk.sdkInitialize(getApplicationContext());然后 ParseFacebookUtils.initialize(this);仍然出错
    猜你喜欢
    • 1970-01-01
    • 2012-12-18
    • 1970-01-01
    • 2017-06-04
    • 1970-01-01
    • 2013-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多