公共验证器和错误 "commons-logging defines classes that conflict with classes now provided by Android"
commons-validator and error "commons-logging defines classes that conflict with classes now provided by Android"
最近 Android Studio 更新后,我可以在调试模式下构建和 运行 应用程序,但由于以下错误,我无法再构建发布版本:
Error:Error: commons-logging defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar. [DuplicatePlatformClasses]
我已阅读 and 。两个答案都建议 "exclude module: 'httpclient'"。它不能解决我的问题。我相当确定它与以下内容有关:
compile 'commons-validator:commons-validator:1.6'
谁能提供一些补救方法?
问题出在公共日志记录上。所以必须排除。
在app/build.gradle中添加如下代码。应该可以。
configurations {
all {
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
}
最近 Android Studio 更新后,我可以在调试模式下构建和 运行 应用程序,但由于以下错误,我无法再构建发布版本:
Error:Error: commons-logging defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar. [DuplicatePlatformClasses]
我已阅读
compile 'commons-validator:commons-validator:1.6'
谁能提供一些补救方法?
问题出在公共日志记录上。所以必须排除。 在app/build.gradle中添加如下代码。应该可以。
configurations {
all {
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
}