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.
Related
I was working with Google Map in Eclipse ADT. I followed this and this tutorial. Everything went smooth. However, right now, when I tried to build the project, Eclipse is saying
"Android Library projects cannot be launched"
I tried again from the beginning thinking that I might have clicked some wrong check boxes however the error still persist. The only library project I have imported is the google play services libs.
Any help would be great. Thanks :)
This error is coming because of the fact that you have checked the box "Is Library" in the Properties option for your project. Please uncheck that checkbox and you wont see that error again. Your proejct is a app project which is referencing Google Play Services, which is a library its referencing but your project is not a library, hence you have to uncheck that checkbox as library projects cannot be launched as they do not contain .apk file.
Here are the steps to run the Map project as a app project and not as a library:
- In the Package Explorer, right-click the library project and select Properties.
- In the Properties window, select the "Android" properties group at left and locate the Library properties at right.
- **Do not** select the "is Library" checkbox and click Apply.
- Click OK to close the Properties window.
Make sure that you have declared your fragment activity in your manifest file with Internet and Map Receive permissions.
I was developing a simple app and eclipse says that i cannot run the app because there are errors. I try to find that error, but everything is perfect! Its a simple app(a counter)...
Please Help!
Print Screens:
[I cannot post images because of my low reputation(this is my third question)]
EDIT:
There is nothing wrong and it does not report any bug. When i click "RUN" it just says "Your project contain error(s), Please fix them before running your application".
Let's try to make a full clean of your project.
Right click your project name. Android Tools > Fix Project Properties. If you have multiple Library Projects linked to this project, follow the same step with them first.
Hit the top menu Project > Clean. Select the radio button Clean all projects and hit OK.
You should leave Eclipse doing its job (depending on the amount of projects and files, it may take a while). If this doesn't work, follow the same process, but as a third step, close Eclipse and restart it right after you hit the OK button. Eclipse is powerful, but a silly IDE sometimes.
If the problem is there after restarting, and you have some libraries attached, check inside the Project build paths (right click the project name, Project Properties > Java Build Path) have the proper JARs, only once, and before any Android Library
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.
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
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