我尝试用于“ net.sf.json-lib”。 我已经在build.gradle中设置了配置
android{
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
}
}
dependencies {
compile group: 'net.sf.json-lib', name: 'json-lib', version: '2.4', classifier: 'jdk15'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
}
但是在构建和安装到电话期间,我收到以下消息。
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class org.apache.commons.collections.ArrayStack found in modules commons-beanutils-1.8.0.jar (commons-beanutils:commons-beanutils:1.8.0) and commons-collections-3.2.1.jar (commons-collections:commons-collections:3.2.1)
Duplicate class org.apache.commons.collections.Buffer found in modules commons-beanutils-1.8.0.jar (commons-beanutils:commons-beanutils:1.8.0) and commons-collections-3.2.1.jar (commons-collections:commons-collections:3.2.1)
Duplicate class org.apache.commons.collections.BufferUnderflowException found in modules commons-beanutils-1.8.0.jar (commons-beanutils:commons-beanutils:1.8.0) and commons-collections-3.2.1.jar (commons-collections:commons-collections:3.2.1)
Duplicate class org.apache.commons.collections.FastHashMap found in modules commons-beanutils-1.8.0.jar (commons-beanutils:commons-beanutils:1.8.0) and commons-collections-3.2.1.jar (commons-collections:commons-collections:3.2.1)
Duplicate class org.apache.commons.collections.FastHashMap$1 found in modules commons-beanutils-1.8.0.jar (commons-beanutils:commons-beanutils:1.8.0) and commons-collections-3.2.1.jar (commons-collections:commons-collections:3.2.1)
Duplicate class org.apache.commons.collections.FastHashMap$CollectionView found in modules commons-beanutils-1.8.0.jar (commons-beanutils:commons-beanutils:1.8.0) and commons-collections-3.2.1.jar (commons-collections:commons-collections:3.2.1)
Duplicate class org.apache.commons.collections.FastHashMap$CollectionView$CollectionViewIterator found in modules commons-beanutils-1.8.0.jar (commons-beanutils:commons-beanutils:1.8.0) and commons-collections-3.2.1.jar (commons-collections:commons-collections:3.2.1)
Duplicate class org.apache.commons.collections.FastHashMap$EntrySet found in modules commons-beanutils-1.8.0.jar (commons-beanutils:commons-beanutils:1.8.0) and commons-collections-3.2.1.jar (commons-collections:commons-collections:3.2.1)
Duplicate class org.apache.commons.collections.FastHashMap$KeySet found in modules commons-beanutils-1.8.0.jar (commons-beanutils:commons-beanutils:1.8.0) and commons-collections-3.2.1.jar (commons-collections:commons-collections:3.2.1)
Duplicate class org.apache.commons.collections.FastHashMap$Values found in modules commons-beanutils-1.8.0.jar (commons-beanutils:commons-beanutils:1.8.0) and commons-collections-3.2.1.jar (commons-collections:commons-collections:3.2.1)
Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
请帮助我