如何将 .jar 文件添加到 Android Studio(0.4.0 版)项目中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20720347/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to add a .jar file into Android studio (version 0.4.0) project
提问by Prasad Nair
How to add a jar file into a Android studio project. For example I am trying to add ksoap2-android-assembly-3.1.1-jar-with-dependencies.jar into a project. Dont see an option anywhere to add the jar file into the project so as to access the library functions within it.
如何将 jar 文件添加到 Android Studio 项目中。例如,我试图将 ksoap2-android-assembly-3.1.1-jar-with-dependencies.jar 添加到项目中。不要在任何地方看到将 jar 文件添加到项目中以便访问其中的库函数的选项。
回答by Scott Barta
Create a libsfolder in your project and copy the jar into it. In the project view, right-click on the jar and choose Add as Library.
在您的项目中创建一个libs文件夹并将 jar 复制到其中。在项目视图中,右键单击 jar 并选择Add as Library。
回答by Dhina k
No need to add jar file just use library in gradle file...the main advantage of android studio is gradle. for more info click here http://androiddhina.blogspot.in/2015/04/add-ksoap2-to-android-studio.html
无需添加 jar 文件,只需在 gradle 文件中使用库...android studio 的主要优点是 gradle。有关更多信息,请单击此处http://androiddhina.blogspot.in/2015/04/add-ksoap2-to-android-studio.html