0

I want to use Single Sign On feature to integrate Facebook to my app. It works on an emulator (shows the user authorization dialog), but not on a device with a Log message "Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider".

The Key hash is probably correct since i'm not getting invalid key errors like this and also when I don't use SSO, but force the traditional way, it works fine.

It's not this problem either, because I have included the required code.

I have read this, but didn't help either.

My code looks like this:

public class LoginActivity extends Activity {

Facebook facebook = new Facebook("123425315215"); // my actual code is not that

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);

    facebook.authorize(this, new DialogListener() {
        public void onComplete(Bundle values) {Log.d("TAG","SUCCESS");}

        public void onFacebookError(FacebookError error) {Log.d("TAG","onFacebookError "+error.getMessage());}

        public void onError(DialogError e) {Log.d("TAG","onError "+e.getMessage());}

        public void onCancel() {Log.d("TAG","onCancel ");}
    });
}

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

    facebook.authorizeCallback(requestCode, resultCode, data);
}
}
Community
  • 1
  • 1
sk1ll3r
  • 275
  • 3
  • 15
  • have you used Android hash Key..??? – SilentKiller Sep 27 '12 at 11:44
  • what happens when you debug the program? does it go into the `onActivityResult`? – thepoosh Sep 27 '12 at 11:46
  • If this is a problem with the hash key as asked by @SilentKiller, see if this works for you: http://stackoverflow.com/a/10516629/450534. The answer (in case it's a problem with the hash key) is in the 2nd comment than the actual answer itself. – Siddharth Lele Sep 27 '12 at 11:49
  • nope, the program doesn't go to `onActivityResult` – sk1ll3r Sep 27 '12 at 12:27
  • @SiddharthLele i don't understand what you meant by "I had not created a hash key using my signing key. I just had the one hash key created using the debug.keystore default signing key." in the answer. i have generated the hash key using this command `keytool -exportcert -alias androiddebugkey -keystore D:\.android\debug.keystore | openssl sha1 -binary | openssl base64` is that the correct way? – sk1ll3r Sep 27 '12 at 12:33
  • you need to create Android Hash Key using the signed Key Store.... – SilentKiller Sep 27 '12 at 12:52
  • @sk1ll3r: That is correct. But I found the method in the comment from the answer as an easier way of finding the Hash Key out. I got that tip from one of the posts on SO. You need that Hash Key to start communicating with the Facebook API. – Siddharth Lele Sep 27 '12 at 13:00
  • @sk1ll3r: This is a good tutorial too: http://www.helloandroid.com/tutorials/using-facebook-sdk-android-development-part-1 – Siddharth Lele Sep 27 '12 at 13:02
  • @SiddharthLele the cmd freezes when i follow `openssl base64 -in debug_sha.txt > debug_base64.txt` in the tutorial :S – sk1ll3r Sep 27 '12 at 13:25
  • Are you using JDK v7?. That is know to create problems with this. Try the alternative from the answer linked. That should work. – Siddharth Lele Sep 27 '12 at 13:26
  • that was actually the way i tried first, but it didn't work. maybe i'm not using the signed apk... how do i get one and do you know what is the Tag of the error if it should appear in LogCat? – sk1ll3r Sep 27 '12 at 13:30
  • The third comment in that answer is how it will look in your logcat. just go through the entire result in logcat and you should find it. Pause the logcat if there are to many outputs. – Siddharth Lele Sep 27 '12 at 13:37
  • i've done as you said (signed my app and logged), but haven't found any log messages that would say key mismatch (at this stage i have change the key on the developers website to "ohmygod" so it def. can't be right. – sk1ll3r Sep 27 '12 at 13:53
  • it turned out that my old key was correct and the problem was that the facebook app was not updated which is ridiculous because it might not work on devices with older versions of facebook – sk1ll3r Sep 27 '12 at 14:56

0 Answers0