5

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.

Rookie
  • 597
  • 3
  • 8
  • 18
  • have you put the jar in libs folder and link that in Build path in using eclipse ? – Dheeresh Singh Jun 30 '12 at 13:56
  • I am sorry, I don't know how to do that. This is how I have added the library project. Right CLick the new Project, Then Properties, then Android, then I added the library. – Rookie Jun 30 '12 at 13:59

7 Answers7

4

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!

muetzenflo
  • 5,653
  • 4
  • 41
  • 82
2

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

1

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

Aqif Hamid
  • 3,511
  • 4
  • 25
  • 38
1

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:

  1. Create ActionBarSherlock project in Eclipse
  2. Right-click your project and go to Properties
  3. Select Android in the left pane
  4. 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).

xbakesx
  • 13,202
  • 6
  • 48
  • 76
0

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/

Dheeresh Singh
  • 15,643
  • 3
  • 38
  • 36
0

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

bhekman
  • 3,227
  • 21
  • 24
  • 1
    Hi Brad, Tried it Its not generating the .jar file. – Rookie Jul 01 '12 at 09:26
  • Not generating, but also no errors in the actionbarsherlock project (it should appear in the bin folder)? What happens if you try a normal build project immediately following the clean? – bhekman Jul 01 '12 at 09:29
0

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

nitishagar
  • 9,038
  • 3
  • 28
  • 40