Search code examples
androidfacebookbuildpath

Unable to load Facebook SDK to Eclipse. Build Path Error


So I have not been able to even start coding for the app I want to build, I am having a really hard time getting the SDK set up for me to code based on it.

Here is what I did:

  1. Downloaded Eclipse
  2. Downloaded the JDK, Android SDK, and ADT on Eclipse.
  3. Created a directory named "Facebook", where I cloned: https: //github.com/facebook/facebook-android-sdk .git (Separated to avoid the spam mechanisim :P)
  4. Created a new project from existing source; please note that on the tutorials it reads "Create project from existing source" as an option within the "New Android Project" workflow, but my Eclipse only has "Android Project From Existing Code" (see: http://db.tt/gOmutx08 and that is what I used) as a separate workflow. Also, there is no "New Android Project" here, only a new "Android Application Project" and this does not prompt me to select an existing project as source (see: http://db.tt/usuzcTxS ). Not sure if this is where the problem is coming from.
  5. Created a new project, and added the SDK project we created previously as a reference library.

The problem must definitely be on step number 4 as I get the following errors on my Eclipse Problems logger:

a) Description Resource Path Location Type The container 'Android Dependencies' references non existing library 'F:\Users\Desktop_1\Android\Facebook SDK\facebook-android-sdk\facebook\bin\facebook.jar' Test-Facebook Build path Build Path Problem

b) Description Resource Path Location Type The method onClick(View) of type new View.OnClickListener(){} must override a superclass method FbDialog.java /facebook/src/com/facebook/android line 101 Java Problem

c) Description Resource Path Location Type The method onServiceConnected(ComponentName, IBinder) of type Facebook.TokenRefreshServiceConnection must override a superclass method Facebook.java /facebook/src/com/facebook/android line 575 Java Problem

d) Description Resource Path Location Type The method onServiceDisconnected(ComponentName) of type Facebook.TokenRefreshServiceConnection must override a superclass method Facebook.java /facebook/src/com/facebook/android line 581 Java Problem

e) Description Resource Path Location Type The project cannot be built until build path errors are resolved Test-Facebook Unknown Java Problem

Where the main problems are a and e, as the project cannot be built if there is an issue with the build path. Problems b through d can easily be fixed by removing the "@override" annotation from all three lines; however, I am not sure this is the actual fix because the SDK should have no issues in the first place, and removing the annotation may not make it work in the end.

Any ideas as to what I could try? I have already deleted the whole SDK download, and recloned the repository several times, even on different folders. Not sure anymore, and I am not sure why the screenshot from the tutorial looks way different than my eclipse. My guess is that the tutorial is slightly outdated as it still uses Froyo as a target :P

Any help is appreciated.


Solution

  • I had faced most issues you faced. I had it resolved. Eclipse for some reason chose to keep facebook project is Java 1.5 eventhough my eclipse preferences had the setting to use Java compiler 1.6.

    So, go to Project Properties in facebook project and select the java compiler to be 1.6. This solved my problem. Hope it solves yours too.