简体   繁体   English

将库添加到Android Studio

[英]Adding library to Android Studio

I have been trying to add a library to android studio and have encountered a few problems. 我一直在尝试向android studio添加库,遇到了一些问题。 I have looked everywhere and think I am doing this correctly, however, then, when I open a java file that is used by the API, it tells me that the sources aren't found. 我到处都看了看,以为我做得正确,但是,当我打开API使用的Java文件时,它告诉我找不到源。

The class WSClient is used by the vtwsclib.jar file and I have no clue on how to attach sources to this. WSClient类由vtwsclib.jar文件使用,我对如何将源附加到此一无所知。 The API used can be downloaded from this site http://forge.vtiger.com/frs/?group_id=181&release_id=573 . 可以从该站点http://forge.vtiger.com/frs/?group_id=181&release_id=573下载所使用的API。 I am using java to call the methods from the WSClient. 我正在使用Java从WSClient调用方法。

只需将.jar文件放在您项目的“ libs”文件夹中即可

You should put the jar file in your libs folder and add a dependency in your gradle file: 您应该将jar文件放在libs文件夹中,并在gradle文件中添加依赖项:

dependencies {
   compile files('libs/your_lib.jar')
}

Than sync your project and you'll be able to access the classes inside the jar file. 比同步项目,您将能够访问jar文件中的类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM