Android Facebook SDK 4 in Eclipse -


are there way import new facebook sdk android eclipse without gradle or maven (something past way)? i've been watching pages don't find way.

thanks

i have faced problem, write short guide, how install in eclipse.

step 1. import eclipse

first of all, download latest version of sdk (on current moment 4.0). unzip folder.

open eclipse, click right mouse button in "packageexplorer" , choose "import". after that, go "android" -> "existing android code workspace".

enter image description here

now click "browse" , choose unzipped sdk folder, , deselect other found projects, except "facebook" (it sdk). other included projects samples, , don't need them now.

enter image description here

you may select "copy project workspace" checkbox, if need this.

step 2. fixing errors

after importing, see, whole facebook sdk package in errors:

enter image description here

but if closer, , open 1 of marked error classes, find, sdk tried importsupport.v4 library:

enter image description here

it required compilation. can find instructions how download using android sdk managerhere.

after downloading, can find in android sdk folder: <sdk>/extras/android/support/v4. add facebook sdk project: right mouse click on sdk project -> "properties" -> "java build path" -> "libraries" -> "add external jars", , choose android-support-v4.jar it's folder.

enter image description here enter image description here enter image description here

after lot of errors gone:

enter image description here

but, there other errors. going class, , found error code piece. move mouse pointer on it, , eclipse show hint, of kind of error facing. says compliance java must version 1.7. allow eclipse clicking "change project ...", or manually going "properties" -> "java complier" -> "compiler compilance level" -> "1.7".

enter image description here

or

enter image description here

moving ahead. facing 1 kind of error, says fb sdk can't find required bolts android library.

enter image description here

we going google, found compiled jar in repository. choose latest version (for current moment it's 1.2.0, sdk gradle file using 1.1.4, may choose that), , download jar. add facebook sdk external lib, before.

enter image description here

voila! ther no errors anymore!

enter image description here

also don't forget set in facebook sdk project "properties" -> "android", library.

enter image description here

just ensurance, close/re-open sdk project , clean ("eclipse menu" -> "project" -> "clean"), files can build properly.

step 3. add android project

now can try add android app. go android app project "properties" -> "android" -> "library" -> "add", , choose facebook sdk.

enter image description here

follow official tutorial, , set android application project (don't forget add required elements manifest.xml). can use this tutorial add loginbutton activity. try build it. should run without problem.

enter image description here


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -