如何在Android Studio中添加apache commons集合(Gradle) [英] How to add apache commons collections in Android Studio (Gradle)

查看:528
本文介绍了如何在Android Studio中添加apache commons集合(Gradle)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 由于: java.lang.ClassNotFoundException:未在路径中找到类org.apache.commons.collections.ListUtils:DexPathList [[zip文件/data/app/com.meridianaspect.wiw-2/base.apk], nativeLibraryDirectories = [/ vendor / lib,/ system / lib]] 

所以我想我必须导入该库通过gradle不知何故,但我不知道如何做到这一点?

解决方案

将jar文件放在libs文件夹中你的模块的根。然后选择File - > Project Settings。在左侧选择要添加此lib的模块,在右侧选择选项卡Dependencies。在底部按加号并单击文件依赖关系。然后选择你的jar和同步项目

Im trying to use ListUtils but when I ran the app I got this error:

 Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.commons.collections.ListUtils" on path: DexPathList[[zip file "/data/app/com.meridianaspect.wiw-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]

So I guess I have to import that library via gradle somehow, but I dont know how to do that?

解决方案

Place the jar file in the libs folder in the root of your module. Then File -> Project Settings. In the left side choose the module where you want to add this lib, in the right side choose tab Dependencies. In the bottom press Plus sign and click File dependency. Then choose your jar and sync project

这篇关于如何在Android Studio中添加apache commons集合(Gradle)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆