Cannot start using SDK for Facebook

I am stuck when I try to launch the application using the FacebookSDK for Android included in my project in IntelliJ IDEA.

With the basic Android template, everything builds and works fine. But as soon as I try to add the SDK for Facebook to my project, as described in this post , I get a few errors:

java: /Users/me/Projects/Android/facebook/src/com/facebook/widget/LoginButton.java:25: package android.support.v4.app does not exist java: /Users/me/Projects/Android/facebook/src/com/facebook/widget/LoginButton.java:33: cannot find symbol symbol : class R location: package com.facebook.android 

Project details

Detailed screenshots:

enter image description here

enter image description here

enter image description here

Why is this and how can I solve it?

Download: you can download the test project here .

+7
source share
2 answers

The problem with your project is that the SDK for Facebook has a modified AndroidManifest.xml file that indicates the wrong package that calls the R.java file that will be created in another package, working import.

The original AndroidManifest.xml file can be found here :

 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.facebook.android"> <application/> <uses-sdk android:minSdkVersion="8" /> </manifest> 

See also my answer regarding the correct dependency configuration of android-support-v4.jar .

+6
source

Android v4 support is an Android support library. It supports multiple classes for older versions of the SDK. You can find the jar in your SDK under additional features. You must include it in your project.

+2
source

All Articles