Installing ActionbarSherlock with Android Studio?

ryandawkins picture ryandawkins · May 16, 2013 · Viewed 29.7k times · Source

As many other Android Developers I installed Android Studio, but how do I install actionbarsherlock into Android Studio?

Any help? I have no idea where to even start.

Answer

wired00 picture wired00 · May 16, 2013

I also had a problem getting ActionBarSherlock running. I had an existing project, but it sounds like you simply want ABS From scratch. Here are step by step instructions of what to do :

1) Download ABS here: http://actionbarsherlock.com/

2) Extract ABS, you should have a directory in there called "actionbarsherlock". Copy that to your Android Studio workspace. and rename to ActionBarSherlock (changed casing) -- > I now have my Android Studio Projects under \*documents*\Android Workspace\ As opposed to \Eclipse Workspace\

So you should now have something like :

\*documents*\Android Workspace\ActionBarSherlock\

Along with your main project maybe:

\*documents*\Android Workspace\TestProject\

3) Open Android Studio load your TestProject then goto File> Import Module... Now navigate to ActionBarSherlock under \*documents*\Android Workspace\ActionBarSherlock\ Click Ok and next all the way to finish. It will ask if you want to set a dependancy to the new Module (or at least mine did) click OK

4) What i found at this point is that when compiling I was getting errors in \ActionBarSherlock\test\ complaining about Junit. I simply deleted the \Test\ directory from my ABS Module under project view. Right click \test\ > Delete...

5) you should now be able to compile without errors :)

Hopefully that helps someone.

Essentially though, I needed to re-download a completely fresh ABS, expunge my old project's ABS (which was probably quite old) then Import Module...

EDIT: This was written a while ago so I'm not sure how relevant it is today, but as Paulo mentions in the comments try these steps, and also have a read of the general import library to ABS thread over here --> How do I add a library project to Android Studio?