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.
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?
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.android.support:support-v4:13.0.+'
}
Found that from ActionBar Sherlock with Android Studio 0.2.2
This question should be closed and linked as dupe. The above line adds the lib as maven dependency and therefore doesn't need to be included as a whole project. It also lets you control the version from one line. Fantastic fix. Thank the OP on the other question for posting.
Here is a sample project on github as well:
https://github.com/JakeWharton/ActionBarSherlock-Gradle-Sample
The support library version number is not critical make sure you always use the most up to date version permitted by your project. The actual inclusion of the support jar as a whole is NOT optional
wired00's answer is good, but I had the following error during compilation :
android-apt-compiler: No resource found that matches the given name 'Theme.Sherlock.Light'
It happened that ActionBarSherlock was compiled as an application project. It was a bit hard to find the check box to compile it as a library, so in case you have the same problem, go to :
File > Project structure > Facets > ActionBarSherlock > Check "Library module".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With