Cordova Facebook Connect plugin fail on init

I installed the FacebookConnect plugin into my cordova project with the code:

cordova -d plugin add /Users/your/path/here/phonegap-facebook-plugin --variable APP_ID="123456789" --variable APP_NAME="myApplication"

Then linked the Facebook API (3.8.0) in /platforms/android/project.properties with:

android.library.reference.2=../../facebook-android-sdk-3.8.0/facebook

Then copied the example 'Simple' into the /www folder, added my app id and changed phonegap.js to cordova.js.

When I compile and run the application on my android phone I receive the following errors:

Cordova Facebook Connect plugin fail on init
Cordova Facebook Connect plugin fail on auth.status

and on login:

Cordova Facebook Connect plugin fail on login!Class not found

LogCat gives the following error:

exec() call to unknown plugin: org.apache.cordova.facebook.Connect

I've scoured the internet but cannot find a solution to this problem.

I did notice that my /platforms/android/res/xml/config.xml file lists the plugin as:

<feature name="FacebookConnectPlugin">
    <param name="android-package" value="org.apache.cordova.facebook.ConnectPlugin" />
</feature>

When the Documentation says that it should be:

<feature name="org.apache.cordova.facebook.Connect">
    <param name="ios-package" value="FacebookConnectPlugin" />
</feature>

But I can't change this as it's automatically generated during the compiling process.

Answers


Did you remember to copy (from the download) www/cdv-plugin-fb-connect.js, www/facebook-js-sdk.js into your apps www folder?


I got the same error, managed to fix by updating my root config.xml (which isn't generated) to include:

<feature name="org.apache.cordova.facebook.Connect">
    <param name="android-package" value="org.apache.cordova.facebook.ConnectPlugin" />
</feature>

(Note android-package as looks like you are using android.)

This is under the manual install section of the readme, but also seems to be necessary after following the automatic install process.

Now you can execute cordova build android from the root, bob's your uncle.


As of 6/13/14 this is what works for me, so I laid out my steps on PasteBin. http://pastebin.com/WvQvqx6U

Basically just reverted back to 0.4.0 of Facebook Connect. It's working perfectly for me, and I didn't have any issues setting it up.


Need Your Help

Ruby FileUtils.mkpath behaves differently on different environments

ruby-on-rails ruby filesystems

I have a rails app that contains a simple piece of code to create a directory if one does not exist.

How to embed SendGrid API into Symfony

php symfony bundle sendgrid

I want to use SendGrid to send emails, in my Symfony 2 project.