Step to add external library in Android Studio
- If you are in Android View in project explorer, change it to Project view as below
- Right click the desired module where you would like to add the external library, then selectNew > Directroy and name it as 'libs'
- Now copy the blah_blah.jar into the 'libs' folder
- Right click the blah_blah.jar, Then select 'Add as Library..'. This will automatically add and entry in build.gradle as compile files('libs/blah_blah.jar') and sync the gradle. And you are done
Please Note : If you are using 3rd party libraries then it is better to use transitive dependencies where Gradle script automatically downloads the JAR and the dependency JAR when gradle script run.
Ex : compile 'com.google.android.gms:play-services-ads:9.4.0'
Read more about Gradle Dependency Mangement
本文介绍了如何在Android Studio中为特定模块添加外部库。首先切换到项目视图,然后在所需模块下创建名为'libs'的目录,并将外部库文件放入该目录。通过右键点击库文件并选择'Add as Library',可以将其添加到项目的build.gradle文件中。此外,还建议使用依赖项管理来简化第三方库的集成。

5103

被折叠的 条评论
为什么被折叠?



