1

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.

daniel_c05
  • 11,438
  • 17
  • 60
  • 78

3 Answers3

9

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.

ddb
  • 1,416
  • 11
  • 17
1

I've repeated Your steps and found out the following:

Seems Yours facebook project is not library one. Please, ensure that under facebook project Android properties 'Is Library' is checked (this should remove a and e errors); enter image description here

sandrstar
  • 12,503
  • 8
  • 58
  • 65
  • When you guys say Mark the "facebook" project as a "Is Library", you are talking about the source project correct? Not the new app I create. EDIT: Also, what do I do with the other three errors? Should I remove the "@override" annotation? – daniel_c05 Jul 04 '12 at 16:23
  • I'm talking about facebook sdk project. Regarding @Override annotations - it's just Yours java compiler setup (check errors under Window->Preferences->Java->Compiler->Errors/Warnings under eclipse). Annotations are usually considered as a good practice, so I would suggest to leave them in place, but update java compiler settings to not treat missed override as error (set it to be just warning) – sandrstar Jul 05 '12 at 07:52
  • This worked for me. I had to delete the lib file with Eclipse (Not via Finder), and I had to set the Java to 1.6 in the SDK lib. – LeviXC Dec 06 '13 at 19:30
0
Create project from existing source == Android Project From Existing Code

I think you have downloaded newer version of Android SDK - API Level 16 - Jelly Bean..

Before API level 16 , we had an option for Create project fron existing source , now it has been changed.

So if you wanna use Project from particular location you can use Android Project From Existing Code..

Also after creating Project make facebook source as library project...

Venky
  • 11,049
  • 5
  • 49
  • 66