Ojonugwa Jude Ochalifu
Ojonugwa Jude Ochalifu

Reputation: 27237

Facebook SDK import to Eclipse cannot resolve java/Android imports

I just imported the Facebook SDK to Eclipse, but the project FacebookSDK has some errors which i cannot fix.The project in the Project Explorer looks like this

enter image description here

But when i open a file, in this case AccessToken.java, it contains all these errors

enter image description here

When i move my cursor over these errors, it says "the import...cannot be resolved".Am i missing something here?

Upvotes: 4

Views: 10228

Answers (4)

user1803558
user1803558

Reputation: 1

Use that link to download https://github.com/facebook/facebook-android-sdk/archive/master.zip

After, get all jars into lib folder.

Upvotes: -1

Piyush
Piyush

Reputation: 18933

You have to first import your Facebook-SDK to Eclipse.

Now Add this Facebook-SDK library project to your Main Project.

Steps for that:

Select Properties->Android ->Select Project Build Target -> Add -> Apply ->Ok.

After adding as a library project if you have indicated as a Green Mark that means your library project imported successfully otherwise red indicated it is not.

Upvotes: 3

Andrew Fielden
Andrew Fielden

Reputation: 3899

Have you set the Android target on your Facebook SDK project?

Right click on the FacebookSDK project, select Properties, then click on 'Android'

Select one of the project build targets.

Upvotes: 3

Ashly
Ashly

Reputation: 1

You need to mark the facebook sdk project as library in the project properties and after that goto to the properties of your project and add a reference project which is the imported facebook sdk

Upvotes: 0

Related Questions