Error: Class not found when unmarshalling: com.facebook.login.Login Client Request

前端 未结 8 1428
故里飘歌
故里飘歌 2021-01-11 14:35

I am getting this error when hitting the \"Login With Facebook\" (Simple login button).

I have Google, and read other topics here - but I can not see any thing mat

相关标签:
8条回答
  • 2021-01-11 15:13

    Actually this is happend. Because of the onActivityResult method has not implemented in side your Activity and also you must call

    callbackManager.onActivityResult(requestCode, resultCode, data);

    method inside this method. I am sure 100% your problem resolved.

    0 讨论(0)
  • 2021-01-11 15:19

    In my case i forgot to add application package name and class name on the developer page of facebook. After i added this information then it worked.

    0 讨论(0)
  • 2021-01-11 15:27

    You should add this to your acctivity

        @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data)            {
        super.onActivityResult(requestCode, resultCode, data);
        callbackManager.onActivityResult(requestCode, resultCode, data);
    

    }

    but if your using parse SDK add this

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        ParseFacebookUtils.onActivityResult(requestCode, resultCode, data);
    }
    
    0 讨论(0)
  • 2021-01-11 15:28

    I too had this issue. Mine however was a login call made within the FBActivity.OnResume method for callbacks to login after accepting fb perms.

    I simply moved the request into the profile tracker in the onCreate method

        ProfileTracker profileTracker = new ProfileTracker() {
            @Override
            protected void onCurrentProfileChanged(Profile oldProfile, Profile currentProfile) {
    
                Profile.fetchProfileForCurrentAccessToken();
                if(currentProfile != null) {
                    String fbUserId = currentProfile.getId();
                    profileUrl = currentProfile.getProfilePictureUri(200, 200).toString();
                    Log.d("FB profile", "got new/updated profile from thread " + fbUserId);
    
                    // jump if logged in already
                    GetFacebookProfileAndJump(currentProfile);
    
                }
    
            }
        };
    

    Also ensure your OnCreate super is as follows

        FacebookSdk.sdkInitialize(getApplicationContext());
        mCallbackmanager = CallbackManager.Factory.create();
        super.onCreate(savedInstanceState);
    
        setContentView(R.layout.activity_fbauth_);
    

    ...

    0 讨论(0)
  • 2021-01-11 15:29

    Check your android:noHistory flag on the activity.

    See link https://developers.facebook.com/bugs/1621984714705591/ look for post by Andreas Bergenwall

    0 讨论(0)
  • 2021-01-11 15:31

    I had the same problem, and solved by putting the facebook_app_id to strings.xml instead of a constant:

    <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />
    
    0 讨论(0)
提交回复
热议问题