3

I'm a new in Android develop and also a new in Android Studio, now I have trouble dealing with support library that is coded by Eclipse. What's the correct way to import it?

I'm using the newest Android Studio and the version of gradle is 2.2.1

here is the url of the SlidingMenu support library it seems that I need to import another support library ActionBarSherlock

Deividi Cavarzan
  • 10,034
  • 13
  • 66
  • 80
陈梓泉
  • 145
  • 2
  • 9

2 Answers2

1

First, you need to include ActionBarSherlock into your project, you can do this by import the file aar that you find in this site:

http://gradleplease.appspot.com/

Then, search for actionbarsherlock and you will find this piece of code:

dependencies { compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' }

Put this code into your build.gradle file (inside app folder). If the dependencies it's alreay there, just include the compile ... line.

The next step is add the SlidingMenu into your project, check into this repository the dependency for the project: https://github.com/jzaccone/SlidingMenu-aar

Then add into build.gradle as same as above.

You can also clone the SlidingMenu into your project and import manually, It's up to you.

Remember to change all of your activities and fragments to extends the SherlockActivity / SherlockFragment.

Deividi Cavarzan
  • 10,034
  • 13
  • 66
  • 80
  • When I import the ActionBarSherlock by " import peoject ", Andoid Studio showed a error: Error:(19, 0) Could not find property 'Compile' on root project 'JakeWharton-ActionBarSherlock-5a15d92'. here is the code at and after (19,0) : tasks.withType(Compile) { options.encoding = "UTF-8" } – 陈梓泉 Apr 21 '15 at 11:48
0

That library is abandoned anyway, but if you want to use it in AS with Gradle here's its repository version with instructions for easier import.

AndroidEx
  • 15,524
  • 9
  • 54
  • 50