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

前端 未结 8 1212
别那么骄傲
别那么骄傲 2020-12-24 05:11

Anyone knows what does this error mean? I get it in LogCat shell every time I connect with my android application to Facebook (via emulator).

The code which in charg

相关标签:
8条回答
  • 2020-12-24 05:25

    As @Vinay-S-Shenoy said, that happens when the Facebook app its not installed on the phone or the simulator. What I do, to avoid this error is to check if the Facebook app its installed before call the facebook.authorize method, an in case the facebook app its not installed I alert this message to the user.

    public boolean isFacebookAvailable() {
    
        Intent intent = new Intent(Intent.ACTION_SEND);
    intent.putExtra(Intent.EXTRA_TEXT, "Test; please ignore");
    intent.setType("text/plain");
    
        final PackageManager pm = this.getApplicationContext().getPackageManager();
        for(ResolveInfo resolveInfo: pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY)){
            ActivityInfo activity = resolveInfo.activityInfo;
            // Log.i("actividad ->", activity.name);
            if (activity.name.contains("com.facebook.katana")) {
                return true;
            }
        }
        return false;
    }
    
    0 讨论(0)
  • 2020-12-24 05:26

    This can happen due to the following reasons:

    1. You are not connected to internet
    2. You have not given permission for internet access ( Manifest.xml)
    3. You have not used a correct hashkey for the app
    4. You did not provide a correct App Id
    0 讨论(0)
  • 2020-12-24 05:26

    If anyone's problem wasn't remedied by the four solutions, this may help. I was getting this same error when I began to use Fragments to implement the Facebook login. I was using the standard Fragment and not the support library v4 Fragments and after switching to the support library Fragment my problem went away. This may be unique to my situation but thought I'd share it just in case. Also don't forget to set the Fragment if you're using the login button method.

    myFacebookLoginButton.setFragment(this); //Assuming you're in a Fragment class
    
    0 讨论(0)
  • 2020-12-24 05:29

    Don't forget to override onActivityResult and check if it called(for example if you using fragments)

    PS(maybe it will be usefull for others, i faced this trouble when was using parse facebook login =)

    0 讨论(0)
  • 2020-12-24 05:30

    Simply add the following permission to the AndroidManifest.xml

    <uses-permission android:name="android.permission.SET_DEBUG_APP"/>
    
    0 讨论(0)
  • 2020-12-24 05:42

    It just means that you don't have the Facebook app installed on your phone. Don't worry too much about it.

    The way the Facebook SDK for Android works is that whenever you need to make a request to Facebook, the SDK checks to see if the Facebook app is already installed on your device. If it is installed, the request is made through the app. If the app is not installed, it fetches the data by itself.

    0 讨论(0)
提交回复
热议问题