I'm creating my first app using cordova 3.3.0 (aka phonegap). Everything's all right : I can run project on to Android Device Emulator and on to my mobile.
I'd like to use the facebook connect plugin : https://github.com/phonegap/phonegap-facebook-plugin
But all the documentation I read (particularly : https://developers.facebook.com/docs/android/getting-started) explains how to set up the Facebook SDK through Eclipse. I've also found doc on how to install in Androïd Studio.
I don't want to install neither of them, I do all in command line since I like to know how things works (at least for my first projetc ...).
So the question is : how do I import facebook SDK into my cordova project ?
Thanks for your ideas !
Alright I found the answer, was struggling with the exact same problem. I was actually trying to get an ionic cordova project to use the facebook plugin
You have to go inside the Platform/android folder of your cordova project. At this point , you are just dealing with a regular android project
run the following command
android update project --target 3 --path C:\Users\<yourname>\Documents\Projects\<projectName>\ionic\platforms\android --library ../../../../facebook-android-sdk-3.7/facebook
Alright a couple of tricks
go to project. properties and you should see something like the following
android.library.reference.1=CordovaLib
android.library.reference.2=../../../../facebook-android-sdk-3.7/facebook target=android-18'
Hope this helps someone, I'm not too fond of using eclipse for phonegap either.
Faced also the same problem today with cordova 3.3. Solution is similar to the other one given, maybe can be helpful. I am on linux environemnt
I managed to build by:
installing the plugin
cordova plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="yourvalues" --variable APP_NAME="yourvalues"
cd /platforms/android
add this line to project.properties
android.library.reference.2=FacebookLib
update the project
android update project --subprojects --path . --target "android-19"
Then compiled successfully with
cordova build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With