How to add a Library Project to a android project?
Solution 1
- File->New->Other
- Select Android Project
- Select "Create Project from existing source"
- Click "Browse..." button and navigate to johannilsson-android-actionbar\actionbar
- Finish (Now action bar project in your workspace)
- Right-click on your project -> Properties
- In Android->Library section click Add
- select recently added project -> Ok
- that's it!
Now you can use it
Solution 2
Checkout this documentation on how to reference a library project in eclipse.
From the link above:
- In the Package Explorer, right-click the dependent project and select Properties.
- In the Properties window, select the "Android" properties group at left and locate the Library properties at right.
- Click Add to open the Project Selection dialog.
- From the list of available library projects, select a project and click OK.
- When the dialog closes, click Apply in the Properties window.
- Click OK to close the Properties window.
Solution 3
Plus to the "best answer", at step 8, if you don't see the project, go to the project what you would like to add as a library and
- open 'project.properties'
- add 'android.library=true'
and you can again follow the instruction and you should see the desirable project.
![DarkLeafyGreen](https://i.stack.imgur.com/rqeRn.jpg?s=256&g=1)
Comments
-
DarkLeafyGreen almost 2 years
I have created a new android project. I want to have a action bar at the top so I downloaded the Action Bar for Android Library because I want to support devices from android 2.1.
The description says
The action bar component is an Library Project. This means that there's no need to copy-paste resources into your own project, simply add the action bar component as a reference to any project.
I am new to android so what does this mean? How can I add the library to my existing project?
Import the library into your eclipse workspace:
File->Import->General->Existing Projects into Workspace, Next
Select root directory: /path/to/project
Projects->Select All
At this point it fails because there is nothing to select and the next button is deactivated.
Any ideas?
-
DarkLeafyGreen over 12 yearsat 4 the dialog is empty, there is no library listed
-
Kurtis Nusbaum over 12 yearsyou have to import the library into your eclipse workspace first. See this post for how to do that: stackoverflow.com/questions/2231474/…
-
Uahmed about 11 yearsi am having same problem as artworkad mentioned but Kurtis i tried ur way and its still showing me nothing
-
David Doria almost 11 yearsBut now you have to have the library project open in your workspace any time you want to work on the dependent project right? Isn't that awkward?
-
woojoo666 almost 10 yearsif your library project doesn't appear in the
Android->Library->Add
list, go toAndroid->Library
of your library project, and make sure "is Library" is checked -
Zar E Ahmer over 9 yearsalso be sure that library has a check in Properties isLibrary=checked