How can I add the facebook sdk to my android project in IntelliJ? I'm familiar with how to add a library project to an existing project in Eclipse, but not in IntelliJ. Anyone know how?
Create Your Project To use the Facebook SDK in an Android Studio project, add the SDK as a build dependency and import the SDK. Go to Android Studio | New Project | Minimum SDK. Select API 15: Android 4.0.
From the main menu, choose File | Project Structure and go to Platform Settings | SDKs. Select the Android SDK and make sure that the correct Java version is selected in the Java SDK field.
The Facebook SDK is a set of software components that developers can include in their mobile app to understand how people use the app, run optimized marketing campaigns and enable Facebook login and social sharing.
IntelliJ IDEA is one of the popular IDE that is used for developing android applications.
The answer below is outdated, please refer to the actual solution.
If it's just a jar, you can add it to the module dependencies.
If you want to use Android Library with source code, you need to create a new Module in IDEA with Android Facet and specify in the facet settings that it's Android Library Project. Configure module content and source roots and then add this module as a dependency to your Android application module.
Here are the screenshots for the Facebook SDK Android Module configuration in IDEA:
Note that the root of the module is set to the facebook subdirectory from the GitHub repository and Is Library Project checkbox is enabled.
If you add this module as a dependency to your application, everything should build fine.
I've also uploaded a sample project that consists of simple sample provided with the SDK and this facebook API module as a dependency, you can download and use it for reference.
Remove if inappropriate - but this solution was much more relevant for the latest version of IDEA and the latest Facebook SDK: https://stackoverflow.com/a/14732898/1711200
Tested with IDEA 12.1.2 and Facebook SDK 3.0.1
My reason for posting this is because the directory structure for the latest Facebook SDK is different & makes this post outdated. I also kept getting directed to this thread, whereas the thread I've linked to is a better & more relevant solution.
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