Saturday, April 28, 2012

facebook-android-sdk\facebook\build.xml:46: sdk.dir is missing


Why:
Missing local.properties in the facebook library project folder. (need to provide the sdk.dir env variable, this solution describes how to make the local.properties)

Dependencies:
Path to tools batch files:
C:\<path_to_location_of_your_android_sdk>\android-sdks\tools

Fix:
Open CMD to the directory of downloaded facebook library:
(Windows) $ android.bat update lib-project -p .
(Linux) $ android update lib-project -p .

This will generate local.properties to keep you going.

local.properties:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.

# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=C:\\
<path_to_location_of_your_android_sdk>\\android-sdks

You can also write this file to that project directory and be done.