I use Cordova 3.4 and the Cordova Facebook Plugin for Android to build a sample Cordova Facebook App on Android.
Here are the steps I did:
1 Create a blank Cordova application
2 edit Test/config.xml and inserted
<feature name="org.apache.cordova.facebook.Connect">
<param name="android-package" value="org.apache.cordova.facebook.ConnectPlugin" />
</feature>
3 Install the Facebook SDK for Android and the Facebook APK
4 From the Cordova Facebook Plugin folder copy ConnectPlugin.java from src/android/ into Test/platforms/android/src/org/apache/cordova/facebook/
5 From the Cordova Facebook Plugin folder copy the www/cdv-plugin-fb-connect.js and www/facebook-js-sdk.js into into your application's Test/www folder
6 go to Test/ and execute cordova build
The last step outputs the following error:
BUILD FAILED
/Applications/adt-bundle-mac-x86_64-20140321/sdk/tools/ant/build.xml:601: The following error occurred while executing this line:
/Users/mg/Documents/Android/Plugins/facebook-android-sdk-3.8.0/facebook/build.xml:46: sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var
Total time: 0 seconds
Error code 1 for command: ant with args: debug,-f,/Users/mg/Documents/Android/Test/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: /Users/mg/Documents/Android/Test/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/src/superspawn.js:112:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
How can I solve this problem?