Problem adding ActionBarSherlock


#1

When following through the steps provided in “For the More Curious: ActionBarSherlock”, when adding the ActionBarSherlock project as a library, I end up with this build error in the console:

[2013-06-05 16:59:32 - CriminalIntent-Ch18-ABS] Found 2 versions of android-support-v4.jar in the dependency list,
[2013-06-05 16:59:32 - CriminalIntent-Ch18-ABS] but not all the versions are identical (check is based on SHA-1 only at this time).
[2013-06-05 16:59:32 - CriminalIntent-Ch18-ABS] All versions of the libraries must be the same at this time.
[2013-06-05 16:59:32 - CriminalIntent-Ch18-ABS] Versions found are:
[2013-06-05 16:59:32 - CriminalIntent-Ch18-ABS] Path: /Users/andrewebling/Documents/Training/BigNerdRanch/JakeWharton-ActionBarSherlock-071a61c/actionbarsherlock/libs/android-support-v4.jar
[2013-06-05 16:59:32 - CriminalIntent-Ch18-ABS] 	Length: 271754
[2013-06-05 16:59:32 - CriminalIntent-Ch18-ABS] 	SHA-1: 53307dc2bd2b69fd5533458ee11885f55807de4b
[2013-06-05 16:59:32 - CriminalIntent-Ch18-ABS] Path: /Users/andrewebling/Documents/Training/BigNerdRanch/CriminalIntent-Ch18-ABS/libs/android-support-v4.jar
[2013-06-05 16:59:32 - CriminalIntent-Ch18-ABS] 	Length: 385677
[2013-06-05 16:59:32 - CriminalIntent-Ch18-ABS] 	SHA-1: b9c504522d97f64025c387493d3989e52bc617bd
[2013-06-05 16:59:32 - CriminalIntent-Ch18-ABS] Jar mismatch! Fix your dependencies

Any ideas how to steer the user around this one please? I’m using ActionBarSherlock 4.3.1 - the current version as of today.

Side note: the internal structure of the zip archive has changed - there’s no longer a sub-folder within the archive called “library” - it is simply called actionbarsherlock now.

thanks,

Andrew


#2

OK I think I found a solution - I needed to delete CriminalIntent >> libs >> android-support-v4.jar in the Package Explorer, then the code compiled and ran OK.


#3

Correct - that’s a version mismatch on the support library. Another fix that would work would be to overwrite CriminalIntent’s old version with the newer one in ABS.


#4

I have the same problem but i can’t get the project to compile.

I deleted CriminalIntent >> libs >> android-support-v4.jar in the Package Explorer but now the project just won’t compile saying that it has errors. I tried “Clean” that didn’t help either. Eclipse won’t let me compile.

I’m kinda frustrated the book glosses over important things at times. If you are a total newbie you are pretty much lost.


#5

This is why we have forums. :slight_smile: There’s no way we could cover everything you might run into in the book itself without making your eyes bleed.

You should be able to fix your problem by right clicking your project in Eclipse and selecting “Android Tools->Add Support Library…”. That will download the latest version of the support library and add it to your project.


#6

Okay, I’m going back and forth between both errors. Initially, I got the dependency error, so I deleted the version of the support library in CriminalIntent >> libs >> android-support-v4.jar.

Then, I started getting errors all across my project stating that my resources couldn’t be found or resolved, so I downloaded the latest version of the Android Support Library.

Doing that, I get thrown back to square 1 where 2 versions of android-support-v4.jar are being found in the dependency library. It’s an infinite loop that I can’t figure out how to escape.


#7

More specifically, my R file seems to get destroyed the second I add a reference to the ABS library.