我想添加'commons-validator'到基于gradle的Android Studio中的我的android项目。我使用UrlValidator来满足我的需求。不能添加依赖项到Android项目
所以我在添加一个应用程序模块的build.gradle的依赖关系:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'commons-validator:commons-validator:1.4.1' // this one
}
而且使用图书馆的AndroidManifest应用标签:
<uses-library android:name="org.apache.commons.validator.routines.UrlValidator"
android:required="true"/>
但加入之后我的项目失败跑步。
Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
而且我得到
Warning:Dependency commons-logging:commons-logging:1.2 is ignored for debug as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages
4次:两个用于调试和两个用于释放。