How to download libraries in Android Studio?

可紊 提交于 2019-12-02 10:07:05

Just go to Maven central and download the libraries.

For example, here is Volley. Just click the download JAR button.

I would strongly recommend sticking with Gradle / Maven, though, to keep consistency with versions and appropriately handle additional dependencies for the libraries you want to download. They are called package managers for a reason, and they do their job well.

The libraries are actually downloaded to disk only once and shared between projects, they aren't downloaded for every new project.

Put library's jar file inside libs folder. Add this line in module level build.gradle (if not present):

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
     // Other libraries
}

Find the gradle dependency for your library and put it in dependencies of your build.gradle file. For Example,

    dependencies {
        // other dependencies
        compile 'com.google.code.gson:gson:2.6.2'
    }

and then build the gradle file.

I'd just run into an issue where a coworker's AS instance wasn't syncing with the server. In that case, we simply had to manually invoke the "Sync Project with Gradle File". For whatever reason, his AS instance wasn't doing that automatically.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!