I'm working on an Android 4.1.2 project, where I'm trying to add a reference to this github project
Following this guide, I've imported the project into the same workspace, and I'm able to select and add the library and get a green checkmark. When I press "Apply" or "OK" the dialog closes, and nothing happens (no rebuild). Then, when I again try to see if it's added, it's not there - not even with a red cross.
I've tried running the project anyway, but it gives me java.lang.ClassNotFoundException: com.handmark.pulltorefresh.library.PullToRefreshGridView
First I choose the library, get the green checkmark
Then I press "Apply" and "OK", and dialog just closes and don't build. When trying to see if library was added, it's not there:
Any suggestions about what's wrong?
Did you or did you not check the "Is Library" option?
You need to reference that library in your android project. Assuming you have imported the library project to eclipse, right click on your project, goto properties, choose android , click add, browse and add the library project.
Clean and build and run. Check if you need to add support library for running on lower versions
Import the library and your project in the same work space. then clean the project and try to add library by the same process you are doing(Properties --> Android --->Add).
Also try restart eclipse.
Related
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
I would like to use the android project PagerSliding
I have imported it into my workspace.
After that I get into MY project properties add a library, and then click apply and ok, so I get :
If I reopen MY project properties right after here's what I get (Eclipse seems to loose the reference to the library).
FYI : I did have 2 workspaces before, but now I'm using only one.
I have resolved to issue by removing eclipse, and reinstalling, seems to be a Eclipse bug when previously using 2 workspaces...
According to this question SO Link
Deleting the project and importing it again worked for me.
i had the same problem there when i try to change my workspace so this my solution:
1. import and copy all project data including library project into workspace
2. delete the old project reference by Right-click on the project-->Properties-->Android-->Library, and select corrupted library(so that waht i call it) and choose Remove
3. clean project first (to refresh ur project properties)
4. go to library project Properties-->Android-->Library and check the is library if it does'nt click Apply then OK
5. if the library project is library is already checked, first Unchecked it then Clean the library project after that do the Step 4 again
6. go to project that u want the library are in then Right-click on the project-->Properties-->Android-->Library, Add then choose the library project (it should be there) and click Apply then OK
7. if still doesn't appear clean the project once more time and that should do
thanks
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.
I am trying to use jfeinstein10 / SlidingMenu http://goo.gl/PEZ9M in my android application.First I have added library project of Sliding Menu, then I added ActionBarSherlock too.Sliding Menu library is dependent to ActionBarSherlock.
Also my app is dependent to SlidingMenu app.
My question is that when I add a library project as a dependency to my main project, the R file of the main project disappears and all my R references in main project cannot be resolved.
does anyone know that R file disappearance issue after adding a library project as a dependency?
Use the Project Properties and clicking on the Android section, change the Project Build Target to Android 4.0.3 (API 15). Clean the project after changing the API Level.
Ok I just struggled through this issue for quite some time now I finally resolved it here are the steps I took.
First of all I updated the android SDK for eclipse to the latest version.
Then I updated eclipse itself by going to Help --> Check for updates
next downloaded the latest version of SlidingMenu and ActionBarSherlock and unzipped them to a folder
Then in eclipse import ActionBarSherlock by creating "New Android Project from existing source" and selecting the "library" folder in the unzipped directory
Repeat the above step for SlidingMenu
Very important at this point to make sure you don't have any errors in your both imported library projects
If you have errors in the ActionBarSherlock then right click the project goto "Android Tools" --> "Add Support libraries". This should resolve any issues you have if not then goto project --> clean and clean up the project
The sliding menu will have a target of 2.2 or 2.1 by default (sorry cant remember which one...its really late and my head feels foggy :z)
Right click on the SlidingMenu project and select properties in the window that opens select target build of Google APIs 4.0.3 select ok and do a CTRL + SHIFT + O and any issues or warnings you had should go away.
With that out of the way then once again right click on the SlidingMenu project and select properties. In the window under Android scroll all the way down and add reference to the ActionBarSherlock library. Also make sure the "Is Library" checkbox is checked. Apply and ok.
Next you have to do the same for your project. Right click on it --> Properties under Android Scroll all the way down and add SlidingMenu as a library. Make sure the "Is Library" checkbox is NOT checked.
At this point I encountered Dependency errors. The problem is that in your projects "libs: folder you will have the files: "android-support-v13.jar" and "android-support-v4.jar" causing a conflict.
What I did was delete the v4 and copy pasted the v13.jar file into the libs folder of all 3 projects, my project, SlidingMeny and ActionBarSherlock.
This resolved the above issue and it worked!
Hope this helps someone so they can go to sleep at sane hours of the night! :)
I just ran into this problem and I didn't need to change my build target. What I had to do it make sure my app and any library that implemented the support Library was using the same support Library version. The easiest way to do this:
Right click on each project and library that is in question and select Android Tools -> Add Support Library... *
I'm creating a new app and I want to use some libraries like this:
https://github.com/JakeWharton/Android-ViewPagerIndicator
I had downloaded this library, added it to my workspace using New Android Project -> Create from existig source.
Went to properties > android, and checked Is Library.
Then I went to properties > android in my app project, and clicked add on the Libraries section, and chose the library, and It show me the library with a green V near it.
I've clicked ok, but couldn't use the library so I've opened the properties > android again, and there was a red cross near the library, and '?' under the "Project" column.
I can't understand why it's happening! It's really annoying, happened to me when I tried to add facebook API to my app, and I just gave up and copied the source to my project.
Thanks, Elad!
Copy every Library manually inside Eclipse Workspace, before importing it, as Eclipse seems to be silly if the Library lays somewhere else. Also symlinking a Library will not work.
For me, I just restart the eclipse and the added library works fine.
I mean first time it showing red marks after adding the library project.
Though eclipse main project and library project are in same workspace folder and no resources files are in outside of the project folder.
So, you can try with to restart your eclipse. Happy coding....