Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash: Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider #805

Closed
Ziv-Barber opened this issue Nov 21, 2014 · 8 comments

Comments

@Ziv-Barber
Copy link

Facebook connect crashing the app with this error:

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

To see it:

  1. Create cordova project.

  2. Add the Facebook Connect plugin.

  3. Verify your facebookconnect.xml that the app ID is OK.

  4. Copy the example code:

    var fbLoginSuccess = function (userData) {
        alert("UserInfo: " + JSON.stringify(userData));
        facebookConnectPlugin.getAccessToken(function(token) {
            alert("Token: " + token);
        }, function(err) {
            alert("Could not get access token: " + err);
        });
    }
    
    facebookConnectPlugin.login ( ["public_profile"],
        fbLoginSuccess,
        function (error) { alert("" + error) }
    );
    
  5. Run and see the app crashing.

P.S.
Anyone know a js code file OpenFB that can communicate with the FB app?

@aogilvie
Copy link
Collaborator

@Ziv-Barber please send us more details from your adb logcat output.

Have you set up your hash with the Facebook Developer site?

This error

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

Is not a crashing error, it's checking if your device has the Official FB app installed before trying to get the users credentials.

@Ziv-Barber
Copy link
Author

I/ActivityManager( 995): START {act=SSO_WITH_FALLBACK
cmp=com.phonegap.sweepGt.
gameON/com.facebook.LoginActivity (has extras) u=0} from pid 1634
W/WindowManager( 995): Failure taking screenshot for (246x410) to layer
21010
D/CordovaActivity( 1634): Paused the application!
D/CordovaWebView( 1634): Handle the pause
D/ConnectPlugin( 1634): onSessionStateChange:OPENING
D/AndroidRuntime( 1634): Shutting down VM
E/AndroidRuntime( 1634): FATAL EXCEPTION: main
E/AndroidRuntime( 1634): java.lang.NoClassDefFoundError:
com.facebook.android.R$
layout
E/AndroidRuntime( 1634): at
com.facebook.LoginActivity.onCreate(LoginActi
vity.java:57)
E/AndroidRuntime( 1634): at
android.app.Activity.performCreate(Activity.j
ava:5008)
E/AndroidRuntime( 1634): at
android.app.Instrumentation.callActivityOnCre
ate(Instrumentation.java:1079)
E/AndroidRuntime( 1634): at
android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2023)
E/AndroidRuntime( 1634): at
android.app.ActivityThread.handleLaunchActivi
ty(ActivityThread.java:2084)
E/AndroidRuntime( 1634): at
android.app.ActivityThread.access$600(Activit
yThread.java:130)
E/AndroidRuntime( 1634): at
android.app.ActivityThread$H.handleMessage(Ac
tivityThread.java:1195)
E/AndroidRuntime( 1634): at
android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 1634): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 1634): at
android.app.ActivityThread.main(ActivityThrea
d.java:4745)
E/AndroidRuntime( 1634): at
java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 1634): at
java.lang.reflect.Method.invoke(Method.java:5
11)
E/AndroidRuntime( 1634): at
com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:786)
E/AndroidRuntime( 1634): at
com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:553)
E/AndroidRuntime( 1634): at dalvik.system.NativeStart.main(Native
Method)

On Tue, Nov 25, 2014 at 4:33 AM, Ally notifications@github.com wrote:

@Ziv-Barber https://github.com/Ziv-Barber please send us more details
from your adb logcat output.

Have you setup your hash with the Facebook Developer site?

This error

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

Is not a crashing error, it's checking if your device has the Official FB
app installed before trying to get the users credentials.


Reply to this email directly or view it on GitHub
#805 (comment)
.

@aogilvie
Copy link
Collaborator

aogilvie commented Dec 1, 2014

@Ziv-Barber

java.lang.NoClassDefFoundError: com.facebook.android.R$layout
com.facebook.LoginActivity.onCreate(LoginActivity.java:57)

com.facebook.LoginActivity is the Facebook SDK package trying to open the layout.xml file in onCreate() to draw the login window. However, it cannot find the R$layout (Resource files). Do you have the whole Facebook SDK attached as a sub-project? Do you have files missing the SDK's res folder? Are you building with CLI? - Try ant clean or re-add the plugin.

@Ziv-Barber
Copy link
Author

I'm building with the CLI.
I have no problem while installing the plugin.
I checked the platform/android folder and I can see a
com.phonegap.plugins.facebookconnect folder inside it.
I guess that the data inside the com.phonegap.plugins.facebookconnect
folder should be mixed with the android folder.
Do you have instructions how to do that so I'll not miss any file?
Thanks for your help

Update:
I tried to copy the layout folder from facebookconnect/facebook/res to android/res and also the facebook's sources files but it failing to compile. Guess that the installation is much more complicated then that:

[javac] import com.facebook.android.R;
[javac]                            ^
[javac]   symbol:   class R
[javac]   location: package com.facebook.android

I can't find any class named 'R' in the sources.

On Mon, Dec 1, 2014 at 2:49 AM, Ally notifications@github.com wrote:

@Ziv-Barber https://github.com/Ziv-Barber

java.lang.NoClassDefFoundError: com.facebook.android.R$layout
com.facebook.LoginActivity.onCreate(LoginActivity.java:57)

com.facebook.LoginActivity is the Facebook SDK package trying to open the
layout.xml file in onCreate() to draw the login window. However, it
cannot find the R$layout (Resource files). Do you have the whole Facebook
SDK attached as a sub-project? Do you have files missing the SDK's res
folder? Are you building with CLI? - Try ant clean or re-add the plugin.


Reply to this email directly or view it on GitHub
#805 (comment)
.

@aogilvie
Copy link
Collaborator

aogilvie commented Dec 2, 2014

@Ziv-Barber you don't need to move any files!

What version of the plugin are you using? Try using 0.10.0 or 0.10.1 because we added better automation for CLI 028a1be

You can also try this -> http://aaroncraig.com/include-facebook-sdk-your-android-app-without-eclipse

@Ziv-Barber
Copy link
Author

Thanks! I'll try it

On Tue, Dec 2, 2014 at 7:30 AM, Ally notifications@github.com wrote:

@Ziv-Barber https://github.com/Ziv-Barber you don't need to move any
files!

What version of the plugin are you using? Try using 0.10.0 or 0.10.1
because we added better automation for CLI 028a1be
028a1be

You can also try this ->
http://aaroncraig.com/include-facebook-sdk-your-android-app-without-eclipse


Reply to this email directly or view it on GitHub
#805 (comment)
.

@Ziv-Barber
Copy link
Author

Working now! I managed to login + using my release hash key.

On Tue, Dec 2, 2014 at 8:34 AM, Ziv Barber zivbarber@gmail.com wrote:

Thanks! I'll try it

On Tue, Dec 2, 2014 at 7:30 AM, Ally notifications@github.com wrote:

@Ziv-Barber https://github.com/Ziv-Barber you don't need to move any
files!

What version of the plugin are you using? Try using 0.10.0 or 0.10.1
because we added better automation for CLI 028a1be
028a1be

You can also try this ->
http://aaroncraig.com/include-facebook-sdk-your-android-app-without-eclipse


Reply to this email directly or view it on GitHub
#805 (comment)
.

@aogilvie
Copy link
Collaborator

aogilvie commented Dec 2, 2014

Great!

@aogilvie aogilvie closed this as completed Dec 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants