ActionbarSherlock not working - android

I am having problems getting start with the ActionBarSherlock. I downloaded the 4.1.0 version and followed the following tutorial for installing it.
http://www.youtube.com/watch?v=4GJ6yY1lNNY
The Problem I am facing is whenever I make a new project and add the library project of ActionbarSherlock to it. I get the following error.
Description Resource Path Location Type
The container 'Android Dependencies' references non existing library 'C:\Work\JakeWharton-ActionBarSherlock-4.1.0-0-g9598f2b\JakeWharton-ActionBarSherlock-88fc341\library\bin\com_actionbarsherlock.jar' myapp Build path Build Path Problem
Please anybody help me with it.

I just had the same problem: A .jar file is requested, but non-existing. Also, it is okay that the file doesn't exist, because we want to use a Android-Library Project and not an included jar-library.
The steps described by Aqif Hamid are perfectly fine, if the missing import (.jar or library project) would be the root of the problem. But i figured out that the reason for this error is that you have to set both projects (AndroidBar Sherlock and your own Android project) to Java Compliance Level 1.6
To do so go into Project Properties => Java Compiler and set the level to 1.6
Of course, you have to install JDK 1.6 on your computer...
Hope this helps you too!

The only thing that it works for me was selecting at Properties at Java Compiler Tab Compilance Level --> 1.7 (It was 1.6).
After that Android Tools, Fix Project Properties

DO the followings:
just like you have bin, res folders. right click on your project and
add a folder named 'libs' (if libs folder is not already there).
Then copy paste your com_actionbarsherlock.jar file in this libs folder.
Right-click on your com_actionbarsherlock.jar file and click Add to Build Path.
Now clean and build your project. You should be good to go.
Edit:
To add project as a library do this:
Make sure you have your library project in your projects list and it
is open.
Right click on your project in which you want to add your library
project and select Porperties.
Click Android in properties windows, now scroll down, you will see
library section at the bottom. There press Add button.
Now a window will open in which you will see list of library
porjects. Select your required project and press Ok. Now that library
project must be there with a green tick mark.
Press Apply and Ok button.
You should be good to go now.
regards,
Aqif Hamid

I am of the understanding that you cannot include ActionBarSherlock into your project by adding a jar to your lib directory (or just including the jar at all). You will have to create an android project for ActionBarSherlock then link to it as a library:
Create ActionBarSherlock project in Eclipse
Right-click your project and go to Properties
Select Android in the left pane
Then in the right pane, towards the bottom you can Add... the ActionBarSherlock project you created in step 1.
If you are curious why the jar approach doesn't work, I give you Jake's reply in this thread
(although that's a month and a half old at this point).

1 - create a libs folder (parallel to manifest) and put the jar in that
Your Project -> right click -> Properties -> Java Build Path -> Libraries -> Add Jar ->
yourjar.jar
This video might be useful in case you are having some issues.
http://mobile.tutsplus.com/tutorials/android/jar-for-android/

Clean your actionbarsherlock project. It will generate the .jar file for you when it re-builds.

Using the Android Tools option to Add compatible libraries fixed the problem for me.

Related

Error when creating android project in eclipse

I'm new in Android Developer and i learning. But when i create a new project, this error shown.
and in the error log i have so much error, and i don't know how can i export all of them here.
And In the project explorer, my project shown like this:
I don"t know how can i fix all of this error! Thanks for helping and sorry for my bad english!
UPDATE:
My problem is solved. The problem is from my appcompat-v7 project. My friends give me another link of this project and then try it again, and the problem is solved!
And tnx to all of you for your answers. :)
Following are the steps:
Paste the android-support-v7-appcompat.jar that you have downloaded in libs folder of your project.
Right click on your project, select Build Path -> Configure build path.
Select Library Tab then Add Jar option and browse your recently added v7 jar and click OK
that's it :)
Update :
see here
There seems to be a problem with your external library.
Go to project properties by right clicking on project.
Select android from left menu.
check for the appcompat library in bottom window.
If it is not there, add it from a valid path. Clean the project and run it again.
Right Click on the HDArtworks project.
Go to Properties>>Android
Then in the Library section: If you find a red cross in AppCompat_v7 then Select and remove it.
Then click ok. Now come back to the Solution explorer and select the Appcompat_v7 project. and do the clean and build.
When the appcompat_v7 project error free then again Right Click on the HDArtworks project. Go to Properties>>Android
Then in the Library section: If you find a red cross in AppCompat_v7 then Select and remove it. and click Add select AppCompat_v7 and click OK.
Now Clean and Build the HDArtwork project. It should solve the problem
Offline Method :
1.
or maybe you need Offline added this package.Download with Below Link :
http://downloads.puresoftware.org/files/android/extras/support.zip
extract this in SDK-root Folder/extras/android something like that in Windows : ( for me )
C:\Program Files (x86)\Android\android-sdk\extras\android
well, goto Eclipse and add this in your project by below method :
Right Click on your project Properties > Android,
after Restart, it worked fine.
2.
also, you can Copy this Folder (appcompat) ;
//you can find it with this Address :
C:\Program Files (x86)\Android\android-sdk\extras\android\support\v7\appcompat
or after Added above Download link, now ;
copy this Folder (appcompat) to Workspace and added with Properties > Android to your project.

Type The container 'Android Dependencies' references non existing library android-support-v7-appcompat/bin/android-support-v7-appcompat.jar

I just got some kind of error when trying to using Action Bar Compat support library to my project, I don't know what's wrong, because I have followed the instructions from this link > http://developer.android.com/tools/support-library/setup.html
So, this is the screen shot of the error ..
I also encountered such problem. My error was:
The container 'Android Dependencies' references non existing library 'C:\development\adt-bundle-windows-x86-20140702\workspace\appcompat_v7\bin\appcompat_v7.jar'
To solve this, I went project>properties>java build path>libraries>add jars>appcompat_v7>libs>, then I selected android-support-v7-appcompat.jar. After this, I went to project>clean. This fixed the problem. Hope you find my hint helpful.
As in the instructions you mentioned, please make sure to follow this step to add .jar files instead of directly go to Properties > Java Build Path > Libraries to add them.
In the new library project, expand the libs/ folder, right-click each
.jar file and select Build Path > Add to Build Path. For example, when
creating the the v7 appcompat project, add both the
android-support-v4.jar and android-support-v7-appcompat.jar files to
the build path.
I just had this issue, when creating a new project. After following the instructions from the link you provided, close your project, then close Eclipse, restart Eclipse, open your project then clean and build your project. This did the trick for me.
These days I used the latest android support library 21 and got the same issue.
I followed the answer of #dazilli,but do not work.
Just now,I updated the JDK from 6 to 7,then it solved the problem.
First of all cleanup a library project and build project check library project has bin files after that clean your project its work for me
andriod platform must be android 5.0 and set 'target=21'
make sure download Extras
In my case the files were in appcombat_v7/lib folder, so what i did is right-click the .jar files (there will be two files select android-support-v4.jar) and then select Build Path>Add to Build Path. What it does is that it adds this file to the Build Path (i.e it will add this file to the "bin folder") which will solve the problem.

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.

How to use this library in Android?

I want to make some ActionBar for my application using this library: https://github.com/johannilsson/android-actionbar but I don't know how to import it in my android project. There is no jar file. How can I do?
Flo
First, make sure you're using the latest version of the Android SDK, things have improved dramatically within the last few months.
Install the android-actionbar source code, either downloading it and unpacking it, or (preferably) using git to clone the repository on your system.
(I strongly recommend using the mimic-native-api branch as it is the most up to date.)
Import the android-actionbar project into Eclipse. Note that the library's .project file is located in android-actionbar/actionbar. There is a small sample project in android-actionbar/actionbarexample as well.
The project's library setting should already be set, but you can confirm this by right-clicking on the android-actionbar project in Eclipse, choosing Properties, and confirming that "Is Library" is enabled in the Android settings category.
In Eclipse, right-click on the project that you want to use the action bar library in, and choose Properties. Select the "Android" category in the list on the left. In the "Library" settings on the right, click the "Add..." button and select the android-actionbar library project.
Tip: I've found Eclipse can get a bit squirrely when you edit library code, if you run into errors that don't want to go away, use Project > Clean... to remove the R.java files, etc. ...then refresh your package explorer and rebuild.
You'll want to look at http://developer.android.com/guide/developing/projects/projects-eclipse.html#SettingUpLibraryProject and http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject. The first link explains how to create a Library project: you probably just need to take the github zip file, expand it and then add it to Eclipse. You can then import it into your own project in Eclipse.
Just copy the source into your project folder and add each file as a new class

In eclipse, unable to reference an android library project in another android project

As I was writing up this question I managed to solve it so repeat it here for the benefit of others. Here is the initial problem:
I have created a very simple library project which I want to reference in another project. I have done this previously with no problems so not really sure why it is not working this time. I have:
Flagged the library project via project properties. The default.properties file has this set : android.library=true
In my other project added reference to my library project via project properties. The default.properties file has the reference added as expected ie android.library.reference.1=K:/android_test_ws/applicationRegistrar
The green tick against the referenced library project starts off green and then changes to a red cross.
This implies that there must be something wrong / missing from the library project but I don't know what. My library project on this occasion is MUCH simpler than the previous one I created.
OK Here is the solution which I found when I was looking for the default.properies file of the referencing project (not the library) in my file system. Although the referencing project was in the same eclipse workspace as the library project, the actual files were somewhere else in the file system ie they were'nt in the same parent folder of the library project. As soon as I placed the referencing project in the same physical folder as the library project it all went fine.
I guess that this must be something to do with android using ant underneath the covers.
Edit: The project name needs match the folder name on the file system. What you are seeing in the Project Properties->Android->Library Reference is a relative file system path.
Make Sure both the projects are present in same work space.
To Do it, while importing the projects make sure "copy project into work space" check box is checked.
the same problem will occur if your library project is in different partition from your current workspace. I have the same problem just now. My git source is in C: and I just move my workspace to D: and everything start to collapse.
Simplest way to get the library paths paths correct is to use the GUI from Eclipse to add the library as shown in the following screenshot and let Eclipse take care of putting the correct relative paths in project.properties. Its a common setup to have your library projects hosted at directories vastly different than your main projects that uses the library. This method will work if the "libary project" and the project using it are in the same eclipse "workspace" (they "need not" be in same parent folder):
Please ensure that the library project is marked as "Is Library" - right click on the library project - properties - Android - mark the "Is Library" checkbox - in project.properties of the library project you should have a new entry:"android.library=true. Now add it into the project you want as described in the post below.(the post with image integrated - from Nilesh Pawar).
This bug is referenced several times here 27199, 35786, 36460 & 38052
Maybe by voting for them, it will be fixed one day...
Yet another observation on the same issue.
For me the two projects where on the same parent folder, and were both local inside the workspace. Even then the issue was still happening.
The I edited the "project.properties" file and put the absolute path(with forward slashes '/' for seperator) of the library project. Saved and closed it. Then went to the project properties dialog, removed the library(which was still showing the cross icon but with abs path) and added it back as usual.
Surprisingly the issue is resolved, and the project compiles and runs.
This is really strange and must be a bug with the ADT.
I am using ADT version 20.0.2
when developer referencing the facebook or any other library project then first of all clean the project from eclipse->project->clean project.
that want allow the error of red cross in referencing screen.
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....
Workaround for me was to
Create a new workspace
Import Library Project in that workspace
Import The desired project in that workspace
Having both project and library project the same target Android OS version
Reference library project in my project
solved my problem
i had the same problem there when i try to change my workspace so this my solution:
import and copy all project data including library project into workspace
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
clean project first (to refresh ur project properties)
go to library project Properties-->Android-->Library and check the is library if it does'nt click Apply then OK
if the library project is library is already checked, first Unchecked it then Clean the library project after that do the Step 4 again
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
if still doesn't appear clean the project once more time and that should do
Just restart your eclipse. It's solve my problem
When you have a look at the reference-path before and after, it comes from i.e. "C:/workspace/mylib" and goes to "../../mylib" when copied to the correct location, quite interesting.
FYI,
What worked for me was to delete the 'library' projects (the actual projects) from my workspace (without deleting the files), and then re-importing them using the wizard (import existing android project from source code).
Thanks for posting the question.
I had exactly the same problem while integrating Facebook with my Android application. I fixed the issue by moving my development project to the same Windows drive in which library project was located. Somehow Eclipse is unable to read the library project's location properly from default.properties file if it is in a different drive.
Similar to Sufi Khan's post I also solved this issue with a reboot. My case differed in that when I first accessed Properties->Android and added the library I got a lovely green checkmark. When I closed the dialog Eclipse was still showing class-not-found type errors. When I checked the properties again I saw the red X. But Mr. Kahn's solution (delete the bad lib, restart Eclipse, add the lib again) worked fine.
I'm using the 0702 version of the ADT bundle (starts with "cluster", rhymes with "duck").
I followed the accepted answer but also had to make sure my "project.properties" file was readable.
If the file is readonly (checked into source control) eclipse will not edit it. Adding the library reference will succeed, but the change won't be persisted after hitting OK.
If closing the preferences window and reopening in again removes the library you just added, this may be your solution.
In case your library project still doesn't show up try adding library flag in your library project properties
Add android.library=true
project.properties
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-17
android.library=true

Categories

Resources