0

I've cloned the volley library to /Users/user/volley

How can I import it as a module to my android studio project, powered with gradle, similar to "Import module" option in IntelliJ Idea.

flx
  • 14,146
  • 11
  • 55
  • 70
TpoM6oH
  • 8,385
  • 3
  • 40
  • 72

2 Answers2

2

And the new Android Studio is missing File -> Import module.

That is because AndroidStudio has nothing to do with your build anymore. Gradle is the one, who is actually building your application. And if you want to add volley to your project you have to edit build.gradle script. There are links at the comments or you can use next one as a snippet:

repositories {
    maven {
        url 'https://github.com/Goddchen/mvn-repo/raw/master/'
    }
    mavenCentral()
}

dependencies {
    compile 'com.android:volley:1.0'
}

After you added those lines, press Sync project with gradle files and AndroidStudio will import your module.

Sergii Pechenizkyi
  • 22,227
  • 7
  • 60
  • 71
  • This site is helpful http://gradleplease.appspot.com/ to find dependencies names. But it works only if author update his library and upload its @aar to mavenCentral repository. For those libraries which dont we have community. Check the whole list here: https://github.com/Goddchen/mvn-repo/ – Sergii Pechenizkyi Oct 28 '13 at 14:45
  • And what to do if I have a library as a independent project, even not a jar? In the earlier versions I was able to connect this projects with "Import module" – TpoM6oH Oct 28 '13 at 19:21
  • Thoose are libraries at `gradleplease`, like facebookSDK or actionBarSherlock. Just add dependency line. That's it. Gradle will download, import, etc. it for you. – Sergii Pechenizkyi Oct 28 '13 at 19:53
2

Now the dependency is like that:

dependencies {
    compile 'com.mcxiaoke.volley:library:1.0.+'
}
granko87
  • 211
  • 2
  • 5