unable to run android project as eclipse considering it as a library - android

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.

Related

Adt eclipse phantom error

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

Can't make a reference to google-play-service lib. How can i fix it?

I am beginner in android app development, and i am now learning how to build a app by using Google map API v2.
Something like this:
http://wptrafficanalyzer.in/blog/showing-current-location-in-google-maps-using-api-v2-with-supportmapfragment/
However, i can't make a reference to google-play-service lib in Eclipse
The following is my steps:
Right Click-> Properties-> Andriod-> Library-> Add the google play service lib from my workspace
It seem work (have a green tick) before I press the OK button
But when i do the redo the step 1 to check it , the green tick become a red cross
How can i fix it?
Try restarting the eclipse and do it again and if still does not work check that the library you are linking is in the same partition of your hard drive as the project. They have to be in same drive to work properly with eclipse
go to your project properties, then build path, then order and export. make sure it is ticked..
if that dosnt make an empty object of any class in play services and hover it, then go to fix project setup.... in there should be either add jar or add library....

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.

Cannot import com.google. .... why?

I am simply trying to compile and run the example project from: http://developer.android.com/training/location/geofencing.html
I get the following errors:
package com.google.android.gms.common does not exist
package com.google.android.gms.location does not exist
package android.support.v4.app does not exist
I have tried the following already:
I have download Google API already, see screenshot of my SDK Manager window.
I saw different related posts but have not been successful in compiling this yet - even tried restarting computer.
Screenshot of my SDK Window showing Google API Installed: http://postimg.org/image/xf64h3fu3/
You need to add the Android Support library to your project.
http://developer.android.com/tools/support-library/setup.html
"In order to use a Support Library, you must modify your application's project's classpath dependencies within your development environment."
Please find below Steps to need to follow after downloading it:
Right Click on your Project Explorer.
Select New-> Project -> Android Application Project from Existing Code
Browse upto this path only - "C:\Users*your path*\Local\Android\android-sdk\extras\google\google_play_services"
This will add google play service project into eclipse
Now, Right click on your project (not google play service project) and select "Java Build path".
Select Libraries Tab and click on "Add Jars" button. Locate google_play_service project(NOTE: google play service project should not be closed in pkg explorer window) and add libraries from lib folder and click ok.
(if still not appearing libs then follow this steps) Again right click on your project, select properties and select "Android" option.
From left panel, select "Android" option.
Under "Library" section, you will see "Add" button. Click on that button and locate "google-play-services_lib".
Then click on Apply. It will be added to your project. :)

"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