3

I want to sign in to my app with Facebook, but I get next message to my Logcat:

Failed to find provider info for com.facebook.katana.provider.PlatformProvider

and launcher does not loading. I get my hash key like this.

My code is:

case R.id.btn_start_facebook:
        // callback when session changes state
        // start Facebook Login

        Session.openActiveSession(this, true, new Session.StatusCallback() {

            // callback when session changes state
            @Override
            public void call(Session session, SessionState state,
                    Exception exception) {
                if (session.isOpened()) {

                    // make request to the /me API
                    Request.executeMeRequestAsync(session,
                            new Request.GraphUserCallback() {

                                // callback after Graph API response
                                // with user object
                                @Override
                                public void onCompleted(GraphUser user,
                                        Response response) {
                                    if (user != null) {

                                        Log.d("myDebug",
                                                "Hello " + user.getName()
                                                        + " user id = "
                                                        + user.getId()
                                                        + "!");

                                    } else {
                                        Log.d("myDebug", "User is null");

                                    }

                                }
                            });
                }
            }
        });
JJD
  • 44,755
  • 49
  • 183
  • 309
Kostya Khuta
  • 1,798
  • 6
  • 25
  • 46
  • I had same problem. I logged out from the face book application that was installed on my tablet. After that It was working fine. – user1154390 Jan 26 '15 at 16:58

4 Answers4

10

add permission of internet in menifest of your application

<uses-permission android:name="android.permission.INTERNET"/>
ashfak
  • 341
  • 1
  • 2
  • 6
5

The issue for me was that that facebook app installed on Android was outdated and not consistent with my Facebook Android SDK.

Please look at this page: Developer Facebook and be sure that that the Facebook SDK is consistent with the Facebook app that installed on your Android.

JJD
  • 44,755
  • 49
  • 183
  • 309
0

Maybe you can try to do more error checking like this

if (user != null) {

    Log.d("myDebug",
          "Hello " + user.getName()
          + " user id = "
          + user.getId()
          + "!");
} else {
      Log.d("myDebug", "User is null");

      FacebookRequestError error = response.getError();
      if (error != null) {
           Log.d(String.format("Error: %s", error.getErrorMessage())); 
      }
}
serge
  • 1,500
  • 1
  • 25
  • 46
0

If somebody has that same error and the answers above did not work check if you move your facebook app to SD card. When you connect your smartphone to the pc it automatically disable every apps located at SD card.

The solution that I found was move the Facebook app to the phone again to test. You could also disconnect the smartphone and run the application and it works fine, but you will not have access to debug etc.

user3249186
  • 185
  • 4
  • 13