"is library" project is red crossed - android

I am going to use "library" in "SHER" application. So I made "library" "is library" and used it in "SHER" app. by adding library:
When I look back, it is red crossed:
I am using the ABS. I had imported all the applications from the downloaded "ABS". Please help me

this means that the project cannot be found and there for you are referencing nothing.
you should remove the broken reference and import it again from the correct location
it can also mean that you removed the project referenced from your environment and you should either re-open the project or import it back to eclipse.

Select the row with the red line on it and click Remove. Then Click the Add button, and select library from the dialog box that opens to add the library project to your project, based on their current locations.

It shows that the library where it lies at which path that path doesn't exists.
You need to first remove that library. Click on that library and select Remove button.
After that click on Add button ,and select your relevant library and add it into your application.
I hope this will help you.
Thanks.

Just add the google-play-services.jar file in lib folder directly. Clean the project. Hope it helps.

I solved this problem by imported the project and it's reference all together.
(Fig 1: Enter the path and click refresh to show all projects in that folder. Check the project and it's references)
(Fig 2: Reference project path become relative, and red cross didn't appear any more.)
I don't why importing reference project separately doesn't work. The only difference I guess were the paths.
Update:
checkout this post: In eclipse, unable to reference an android library project in another android project

Red cross mean broken reference to solve that problem you should copy that library in workspace and then import that library in eclipse.
After that you can successfully use that library with green tick symbol in your project.

Related

How to add android library project in another android project in eclipse

I am trying to add a library project in another project but I am unable to add it.
I made e.g. Project A as a library project by going in to its properties and checking isLibrary checkbox. Then I tried to add this in Project B , by going into its properties , and by clicking Add button and selecting Project A as a library.
Then I clicked on ok , but when I try to use any class or reference of Project A , I get an error that it is not defined. I checked Project B's properties again , and there is no reference there of Project A, which I established earlier.
The reference is automatically disappearing. I need help in this.
Edit : Both Projects are in same workspace.
Check this please for example Facebook SDK:
and try to press Apply before press Ok
I've encountered this problem myself. The solution for was based on the location of the library project.
It needs to be in your workspace directory, "next" to the Android project you're trying to connect to it.
Is this the case for you?
You can add project A to the "libraries" folder into project B and then you should be able to use references.Every time the library you are using should be into your main project folder and not in the same workspace.Try this out.
The porblem was read-only persmissions of files of Project B. I eliminated read-only permissions and it is working now. Thanks for suggestions

Importing google-play-service library showing a red X next to this reference android

Am trying to add google-play-service library in my project using import(For Google map). After adding the path am getting red X next to this reference and the reference is not adding . Know how to resolve this ?
The red X means its a broken link path.
http://developer.android.com/google/play-services/setup.html
Copy the google-play services_lib library project to your workspace (folder where your android map project is). The library project can be found under the following path.
<android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib library project .
Import the library project to your eclipse
Click File > Import, select Android > Existing Android Code into Workspace, and browse the workspace import the library project. You can check if it is library project. Right click on the library project. Goto properties. Click Android on the left panel. You will see Is Library checked.
Right click on your android project. Goto properties. Choose Android on the left panel. Click on Add and browse the library project. Select the same. Click ok and apply
Eclipse does weird things when importing an existing project (google-play-services-lib), especially if you try to import and then allow the project to be automatically 'copied' to your workspace. I had the same issue and here is how I fixed it:
Close Eclipse
Erase all google-play-services projects from your workspace
Manually copy the google-play-services-lib folder (....sdk\extras\google\google_play_services\libproject\google-play-services_lib) into your workspace
Open Eclipse
Add a new project, choosing 'Existing Android Project', then navigate to your workspace and add the newly copied google-play-services-lib project
Finally, add the google-play-services-lib to your project as a library (just like you normally would)
Hope this helps! :)
Though it's over a year for this question but never the less thought of putting it down here. Might help some one facing a similar issue.
While doing a File -> Import one probably might have selected the folder,
C:\adt-bundle-windows-x86-20130729\sdk\extras\google\google_play_services\
instead of
C:\adt-bundle-windows-x86-20130729\sdk\extras\google\google_play_services\libproject\google-play-services_lib
Quite strange as Eclipse did not correctly copy the google-play-services_lib project in my workspace, but this caused a cross mark to appear in my Project Properties.
got a perfect solution for your question. this problem is due to improper referencing of library projects. You need follow these step.
create a new project
copy all the java files from src of your previous project in which you are getting error to the new project you have created just now.
Also copy layouts xml files.
now import play services you will not get this error.
I was also getting same problem.
I copied google library folder into work space and import now it's working fine.
Try to place the Google-play-service library with in your same working Directory by coping the files from Click File > Import, select Android > Existing Android Code into Work space, and browse the work space import the library project.
This is common issue Youur google-play-service-lib project and your android project should be inside the same folder For example
if your Android Appplication name is MyMap is in D:/workspace t hen your play service lib project should be in the same directory D:/workspace
Close Eclipse. Delete
.metadata
and
.recommaditions
folders from your workplace. Import your projects back.
You add Project in to your workspace.
Start Eclipse and import project one option is ther copy to workspace do it.
After that add google play services it also copy in to your work space
and add it your library hope so its working.

HoloEverywhere error: build path contains duplicate entry src

I'm developing an app currently which shall use ActionBarSherlock and HoloEverywhere however whenever I try to import the HoloEverywhere library into eclipse I get the following error:
Build path contains duplicate entry: 'src' in project 'library'
I have checked the library folder and there is no duplicate in it but it still complains.
Thank you in advance.
This is how mine solved:
property->resource->Android, tick an Android build target then click OK
Had the same issue,
try this:
Just import it with the duplicate src error, then right click on the HoloeEverywhere library project and select properties. In properties select Android (on the left) and under Project Build Target check if the Target Name Android 4.2 (or whatever yours is) is checked. Mine wasn't. If you check it, it should fix the problem.
Both projects "HoloEverywhere" and "ActionBarSherlock" has name "library". So, you probably should rename them. Then import both projects (ignore HoloEverywhere error). Choose "Android option" in "HoloEverywhere" project properties. Remove all bad references and add new reference to "ActionBarSherlock" project library.
To fix this you have to right click on the project name on the left hand side and choose properties, then choose Android and add a tick to the Build target e.g Android 4.0, don't forget to apply and click ok afterwards.
Right Click on the HoloEverywhere project, go to Android, in the Library section, removes the selected and them select the ActionBarSherlock library that already is in your workspace.
No obvious duplications in path and after hours of trying various suggestions, I change the target (in both the project properties and manifest) from 15 to 17 to solve this issue.
To fix it, open .classpath file in your project home directory and comment out any one of the following two lines
< classpathentrykind="src"path="onePath"/>
< classpathentrykind="src"path="anotherpath"/>
here one and another Paths are the paths that are referencing your library.
Then, right click the Project->Android Tools-> Fix Project Properties. Then clean and build your project.

Red exclamation mark over the project in eclipse

I am trying to run a project but there is a red exclamation mark over the project name. When checked in Problems, its throwing an error "project is missing required library". The library is pointed to android.jar located in some path. When checked in package explorer, I found the android.jar in Android 2.3.1 folder structure of project in package explorer. The android.jar located in Android 2.3.1 folder is pointing to some other path. Is the build error occurring due to the difference in paths for android.jar files? I have imported the project.So, how should I modify the path which is shown in the problems window? I am newbie to android and so pls help me.
Thanks!!!
The easiest way to resolve this common problem is to re-associate your project with an SDK version. You do this by opening project properties, clicking on Android, select a different SDK version to that which is currently selected (if one is selected at all), click okay, and then repeat the process to switch back to the desired SDK version, if desired.
I tried Phillip's answer and it didn't work in my case. Another place to look is opening project properties and clicking on "Java Build Path" -- if your project used some external JARs, check to make sure the links haven't been broken. If they have, reimport them again and remove the missing ones.
Import your library through the option: File/ Import... / Android / Existing Android Code Into Workspace, and not by creating a New Project and referencing the other (if you did this way).
I had this same problem and solved that way. As example, there is a PDF which demonstrates how to import other projects [Look at the page 28] (The material are in Portuguese)

Not able to import the another project as a library?

I am going to licensing my Application. I know all the process for licensing application.
But for that I have to load the Library Project in My Workspace.
I have loaded the Library Project in my WorkSpace then i have imported it into my Original project. It works great.
But now the problem is, If i have once deleted that library project and then if i have imported into workspace from another location and if i import it in to my that project then it is not going to import it.
And if i Import it from the previour one location, then its again works fine. . .
So why it is happening like that?
Why i am not able to import the library project from any location?
Please guide me for this.
Thanks.
I dont know why it is happend. But if you have import once from any location. and then delete it.
Now if you are imported the same project from another location than it is also not going to imported.
For sollution you have to Put that library project at once place for which you what it every time.
And if necessary then do not delete that library project after Importing it to the Original Project.
Thanks.
If you want to include a project to your current project follow the steps,
1.) Right Click(or Alt+Enter) on the project_as_library->Library-> check mark Is Library
2.) Right Click(or Alt+Enter) on the project where you want to include the Library, go to Android->Library->Add. When you click Add you will see the Project name that you declared as Library, selected that and Press Ok and you are done.
From your question, i am assuming that you want to import any library into your project and if you want to use any library(.jar) then you can do these steps:
create "libs" folder inside your application's structure, at same level of "src" directory.
Now copy those libraries into this libs folder.
Right click on any librarary -> Build Path -> Add to Build Path.
Update:
As you have commented below as its library project, i would suggest you to go through this Android doc on Setting up a Library Project

Categories

Resources