Not able to import the another project as a library? - android

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

Related

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.

ZXing-2.1 - Missing libraries

EDIT ::: For people who may be searching for a solution, Here it is.. (using ZXing 2.1)
Follow the steps below :::
First you have to import the existing code into your workspace
File -> import -> android -> existing android code into workspace
Browse to the unzipped folder of ZXing 2.1
You will have two projects in the list. Select both and click OK.
They will be imported into your workspace and you will have errors.
For the first Project (CaptureActivity in my case), you have to add the core.jar file present in ZXing2.1\zxing2.1\core
For the second project (ZXingTestActivity in my case), you have to add the core.jar file present in ZXing2.1\zxing2.1\core and android-integration.jar present in ZXing2.1\zxing2.1\android-integration
That's it.. You are done...
Hope this helps...
I have an application where we use ZXing. I have to update the library to the latest one. So I downloaded the code from ZXing-2.1.zip from here. When I try to compile I get errors in the import statements.
import com.google.zxing.BarcodeFormat;
import com.google.zxing.DecodeHintType;
import com.google.zxing.Result;
I couldn't find these libraries anywhere in the zip that I have downloaded. Can someone please guide me on how this is done? What am I doing wrong?
If you have a step by step tutorial, please do link them.
The classes are found in core.jar. You build this from the source code you downloaded.
I suggest you use the latest code from Subversion actually. If you do that, here's how you can get a pre-compiled JAR, or build one yourself: https://code.google.com/p/zxing/wiki/GettingStarted
(We are releasing 2.2 in a week or two by the way.)
Or if you want to build 2.1, see this previous documentation: https://code.google.com/p/zxing/source/browse/wiki/GettingStarted.wiki?spec=svn2659&r=2659
Extract zip
Right click on project-> properties-> Java Build Path-> Libraries-> Add External Jars-> select the jar file where it is in your Pc-> click ok.

Cannot import google-play-services_lib because the project name is in use

I've done an application which displays a Google map referring this tutorial
http://www.vogella.com/articles/AndroidGoogleMaps/article.html
The application has worked fine and it displayed a Google Map as shown in the tutorial. But now, when I open the project, it shows several errors relating to the import of com.google packages. I've already added the google_play_services_lib. But now, that is not shown in the application. When I try to import the google_play_services_lib again, this error appears,
"Cannot import google-play-services_lib because the project name is in
use"
What is the problem? Please help me.
This generally occurs, if you have a project or folder by the same name existing in your workspace.
In general, You can solve it by changing the name of the existing folder using 'F2' shortcut key. But, since this is a library I recommend you to shift the existing folder "google_play_services_lib" from your workspace directory to somewhere else and then again try and import the "google_play_services_lib" .
this means that google-playservices.lib is using by another projects, you can solve it by.
remove the reference to it from the project which is using it.
OR close that project using eclipse->right click->close.
Remove this project from your workspace then import from your sdk place.
[http://developer.android.com/google/play-services/setup.html#Install]
It seems that when you import google-play-services_lib, Eclipse creates a project by the same name. Even though I deleted manually the google-play-services_lib folder from my workspace folder, I also had to delete the google-play-services_lib project in Eclipse as well. After doing it, I was able to import the lib, and then use it in my project.

"is library" project is red crossed

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.

After importing does not see the library

After importing next problem, does not see the library as I understand.Tell me how to solve the problem
Again, I imported the project, now Screen is not quite empty but not full
aaa Sorry decided I did not put the settings
How did you do the import? I'm not too sure I understand your project structure. Do you have an available JAR file of the library you need? If you do, create a /libs folder in your Android app. Build the project and the import should be available.
If you are importing a library project, right click on your main project, choose Properties then Android then under Libraries, add the library project you need.

Categories

Resources