android studio 怎样添加第三方jar

2025-03-31 05:22:07
推荐回答(1个)
回答1:

将第三方jar包加入到libs文件夹中,打开工程所在Project Structure,然后选择Dependencies,点击那个加号选择File Dependency ,然后再Libs文件夹中选择要导入的jar包。
两外还有一种方法是在project选中jar包点击右键"Add as library",这种方法需要定位到项目的根目录,即build.gradle所在的目录。

dependencies
{
compile files('libs/android-support-v4.jar')
compile files('libs/xxxx.jar')
}