简体   繁体   中英

Add facebook SDK to IntelliJ Android project?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM