Unable to configure Facebook SDK in eclipse - android

I did all the steps according to the facebook tutorial on how to configure the facebook SDK, and without any luck, also tried the github configuration as shown Android Facebook SDK configuration on Eclipse
And I'm still getting in the eclipse environment a "!" sign by the side of the project I included Facebook to it. and when trying to run, it says I have errors.
Without the Facebook SDK I managed to work great on my project and run it, so it is not a problem with my project..
What can I do?

I was trying to get started using Facebook's SDK for Android with Eclipse and couldn't get it to work. After trying different things here is the solution that consistently works:
1) Import (File->Import->Existing Android Code Into Workspace) just the Facebook SDK folder alone (PATH\facebook-android-sdk-3.0.1). (Do not check the copy to workplace)
2) Import (i.e. PATH\facebook-android-sdk-3.0.1\samples\ProfilePictureSample) just one of the sample projects (for now). I will be using ProfilePictureSample as an example
As you can see, Eclipse throws errors saying that it doesn't know what FragmentActivity in ProfilePictureSampleActivity. FragmentActivity is part of the android support library. If you take a look at the package explorer, there is not a libs folder or any reference to the android support lirbary; It is on the FacebookSDK library. We need to tell Eclipse to export it.
4) Right-Click on the FacebookSDK library then click on properties. On the left menu go to Java Build Path. Then under the Order and Export tab check Android Private Libraries (you can also click on the android-supportv4-jar instead).
5) Project->Clean
Now for some reason (maybe somebody can elaborate on this), the sample project also needs to export the android support library.
6) Right-Click on the sample project (i.e. ProfilePictureSample) then click on properties. On the left menu go to Java Build Path. Then under the Order and Export tab check Android Private Libraries.
7) Project->Clean
Hopefully this helps!!

please set the Android Api for this project by this steps below
Rightclick on project->properties->android->set android Target version
Also remove Facebook library project once and again add it.

The problem was that the path to the android-supprort-v4.jar wasn't correct..
Fixed it by setting the correct path.

Import the sdk without copying the project to workspace. this solution has worked for me and does not present any errors

Related

Could not find class 'com.lowagie.text.pdf.PdfReader' [duplicate]

My project ran well until I clicked "Help->Check for updates" and installed some components in Android SDK Manager.
In general, there is no error announced in my project. But when I run my project, it causes an error
could not find class com.androiquery.AQuery
I checked out again, I still can see the AQuery library in libs folder and also the reference to this library.
I also tried to clean the project and its dependencies, quite the eclipse, restart the computer, but it doesn't solve.
Do you know how to fix it?
I have had the same issue as you and have fixed it this way.
Go to Properties > Java Build Path > Order and Export and check the Android Private Libraries box.
See the screenshot below:
It may be one of the following reasons:
Setup problems: adding the jar files manually as well as setting the project type to use Google APIs. This cause problems for some reason.
You are calling activity may be inheriting some class that causes this problem.
I assume your are using ADT? if you are, you can download a .zip with all files in it. From the android developer site
Thanks #Raghunandan. The solution is right click on project. goto java build path. choose order export tab. make sure android private libraries is check. Clean and build. Also make sure you have android sdk build tools from the sdk manager

Error with Eclipse properties disabled

Here is what I have done: Downloaded and installed android SDK, eclipse and added the google repo for developer tools.
Issue is, when I got to Projects->Properties it is greyed out.
I don't understand why? Here is an image for reference:
http://i.imgur.com/DbL8Reh.png
I need to go into properties to make android SDK is installed properly.
Thank you.
Your Package explorer is empty. First create a new project File->New->Android Application Project. Then you can check Projects->Properties.
Or path to your android workspace is not proper.Select File->Switch Workspace to switch to proper workspace.
Do right click on your project folder and click on the properties.Then you will able to find the property dialog box.
And after that the project ->property will be enable.

Getting error while trying to install Facebook SDK for Android

I'm trying to install the Facebook SDK for Android in Eclipse but I'm failing miserably.Eventually my aim is to develop a web app in phonegap and I know I have to get the phonegap plugin for that once I sort out the SDK. But Im failing at the very beginning.
I'm sure I followed all the steps that was laid out in the FacebookSDK-Android guide.Im attaching screen shot of the errors I'm getting to give you guys a better picture.I'm completely new to Android, any help much appreciated.Thanks
https://vimeo.com/69957972
http://i.stack.imgur.com/XnK4O.png
http://i.stack.imgur.com/etxPh.png
Im am getting the same error just as yours, I tried all the methods you mention here.
Same screens I was getting.
The soultion I got is:
You need to create a new clean workspace before importing the facebook SDK
Goto File>>Switch Workspace
When you enter a new path for your workspace, Now import the Facebook SDK and MUST clean the projects as:
Project>>clean
There will be no problems at all. I am now running my applications in my device too without any issues.
You already mentioned that you follow the official installation guide for the Facebook SDK, but I provided a link just in case:
https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/
When I read the guide, my eye caught onto something which might prove to be the source of the error which you experience:
You must unselect the 'Copy projects into workspace' option so that each of the sample projects retains a correct reference to the neighboring SDK. However, this means that Eclipse creates a link to the project in the SDK installation, rather than making a copy of it.
Please let me know whether or not this helps.
Try this:
Right click on the project in the Package Explorer.
Select Android tools->Add support library
Select the latest support library (current rev 13)
Accept License and press install
For the example projects. Check that the path to the library 'facebook.jar' is correct
Right click on the project in the Package Explorer.
Select Properties
Select Java Build Path
Select Libraries
Check that the 'facebook.jar' path is correct

Could not find class

My project ran well until I clicked "Help->Check for updates" and installed some components in Android SDK Manager.
In general, there is no error announced in my project. But when I run my project, it causes an error
could not find class com.androiquery.AQuery
I checked out again, I still can see the AQuery library in libs folder and also the reference to this library.
I also tried to clean the project and its dependencies, quite the eclipse, restart the computer, but it doesn't solve.
Do you know how to fix it?
I have had the same issue as you and have fixed it this way.
Go to Properties > Java Build Path > Order and Export and check the Android Private Libraries box.
See the screenshot below:
It may be one of the following reasons:
Setup problems: adding the jar files manually as well as setting the project type to use Google APIs. This cause problems for some reason.
You are calling activity may be inheriting some class that causes this problem.
I assume your are using ADT? if you are, you can download a .zip with all files in it. From the android developer site
Thanks #Raghunandan. The solution is right click on project. goto java build path. choose order export tab. make sure android private libraries is check. Clean and build. Also make sure you have android sdk build tools from the sdk manager

"Android library projects cannot be launched" in Facebook Android tutorial

I installed both the Android and Facebook SDKs. I did all the steps in http://developers.facebook.com/docs/mobile/android/build/#sdk till Step 6.3.
In step 6.4, when I try to run the project in Emulator (Using Android 4.0.3), I get "Android library projects cannot be launched" and the project doesn't proceed further. Even the logcat doesn't have any content.
Can someone please tell me what may be the problem?
Thanks
Souvik
Folow these steps
1. In the Package Explorer, right-click the library project and select
Properties.
2. In the Properties window, select the "Android" properties group at left and
locate the Library properties at right.
3. Select the "is Library" checkbox and click Apply.
4. Click OK to close the Properties window.
Library projects cant be launched. you can use that in your project and run your project adding it as library.
It would be much better to have the Facebook sdk as a Library so you can simply #import the sdk file into eclipse. Simple. I spent a day trying to get the sample source into a project to test the post on wall. I get the app to run but no breakpoints get called in my project, I had to create the build.xml and not sure if that is the cause. It would be better if the whole test project files were included instead of only the resources and jar files. That way you could just import everything and it should work within 5 mins.

Categories

Resources