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"
.
now click "browse"
, choose unzipped sdk folder, , deselect other found projects, except "facebook"
(it sdk). other included projects samples, , don't need them now.
you may select "copy project workspace" checkbox, if need this.
step 2. fixing errors
after importing, see, whole facebook sdk package in errors:
but if closer, , open 1 of marked error classes, find, sdk tried importsupport.v4 library
:
it required compilation. can find instructions how download using android sdk manager
here.
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.
after lot of errors gone:
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"
.
or
moving ahead. facing 1 kind of error, says fb sdk can't find required bolts android library.
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.
voila! ther no errors anymore!
also don't forget set in facebook sdk project "properties"
-> "android"
, library.
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.
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.
Comments
Post a Comment