Cant login facebook in android “Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider”

点点圈 提交于 2020-01-06 19:48:52

问题


I am a beginner of android programming. I am trying to use facebook SSO, therefore I follow the instruction of facebook developers and write a simple testing code:

public class MainActivity extends Activity {
private Facebook facebook = new Facebook("xxxxxxxxxxxxxxx");
/** Called when the activity is first created. */   

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Button btn = (Button) findViewById(R.id.button1);
    btn.setOnClickListener(new OnClickListener(){
        //@Override
        public void onClick(View v) {
            facebook.authorize( MainActivity.this, new DialogListener(){
                @Override
                public void onComplete(Bundle values) {
                // TODO Auto-generated method stub
                }
                @Override
                public void onFacebookError(FacebookError e) {
                // TODO Auto-generated method stub
                }
                @Override
                public void onError(DialogError e) {
                // TODO Auto-generated method stub
                }
                @Override
                public void onCancel() {
                // TODO Auto-generated method stub
                }
             });
        }
    }); 

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}
}

The first time I finish the coding it works. The dialog pop out and I can input my email and password. However, the same cant work after the first time. I checked the LogCat and find out the error:

10-17 17:10:07.227: E/ActivityThread(638): Failed to find provider info for       
com.facebook.katana.provider.AttributionIdProvider

I have tried many time and what I see is the dialog pop out but close immediately. I have checked for solution and I am sure that the Key Hash matched. Can anyone tell me why? Thanks a lot.

Sorry for my stupid question. I have found that in the LogCat there is a "D/Facebook-authorize(638): Login Success! access_token=...... expires=.....", So I suggest the codes word? however why I dont need to login again even I close my emulator, reboot my computer? How can I switch to other facebook account if I want? Thx a lot.


回答1:


I think the login is success. But here's are some suggestion. If you want to see the dialog page and want to re-enter the user name and password, try to clear the caches of yours apps first before running it again.



来源:https://stackoverflow.com/questions/12939979/cant-login-facebook-in-android-failed-to-find-provider-info-for-com-facebook-ka

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