我在下面提到了我的gradle请告诉我该问题的解决方案是什么,并在我的项目中使用了api level 25
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
signingConfigs {
config {
keyAlias 'yaksha'
keyPassword '123456'
storeFile file('/home/abhinav/Downloads/yaksha.jks')
storePassword '123456'
}
}
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.tene.yaksha"
minSdkVersion 17
targetSdkVersion 21
versionCode 1
versionName "1.0"
multiDexEnabled true
testApplicationId "com.tene.yaksha1"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
testHandleProfiling true
testFunctionalTest true
}
testOptions {
reportDir "$rootDir/test-reports"
resultsDir "$rootDir/test-results"
}
dataBinding {
enabled = true
}
dexOptions {
//incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g"
}
lintOptions {
// lintConfig file("$project.rootDir/tools/rules-lint.xml")
abortOnError false
htmlOutput file("$project.buildDir/outputs/lint/lint.html")
warningsAsErrors false
xmlReport true
}
buildTypes {
release {
minifyEnabled true
debuggable false
jniDebuggable true
signingConfig signingConfigs.config
renderscriptDebuggable true
shrinkResources true
proguardFile '/home/abhinav/Android/Sdk/tools/proguard/yakshaproguard.txt'
}
debug {
minifyEnabled false
proguardFile '/home/abhinav/Android/Sdk/tools/proguard/yakshaproguard.txt'
multiDexKeepFile file('multidex-config.txt')
}
}
packagingOptions
{
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
testOptions {
unitTests.returnDefaultValues = true
unitTests {
all {
jvmArgs '-XX:MaxPermSize=256m'
if (it.name == 'testDebug') {
systemProperty 'debug', 'true'
}
if (it.name == 'connectedDebugAndroidTest') {
}
}
}
}
configurations {
}
}
dependencies {
// compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:design:25.3.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.google.android.gms:play-services:10.2.1'
compile project(':realmtenedbservice')
compile project(':tenewsrestlib')
compile project(':TeneLocationLib')
compile project(':SecurityYsc')
compile project(':library')
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.birbit:android-priority-jobqueue:2.0.1'
compile 'com.fasterxml.jackson.core:jackson-core:2.7.3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.3'
compile 'io.reactivex:rxjava:1.1.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.google.maps.android:android-maps-utils:0.4+'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'io.realm:android-adapters:1.4.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.sromku:simple-storage:1.2.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'joda-time:joda-time:2.9.7'
compile 'id.zelory:compressor:1.0.4'
compile 'io.reactivex:rxandroid:1.2.1'
}
我在运行项目时遇到此错误,你能否提出任何有关此问题的建议
Information:Gradle tasks [:app:assembleDebug]
Warning:Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior.
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/commons/io/CopyUtils.class
Information:BUILD FAILED
Information:Total time: 18.768 secs
Information:1 error
Information:1 warning
Information:See complete output in console
答案 0 :(得分:1)
您可以排除那个显示重复的类,如
dclusr70
答案 1 :(得分:0)
我认为这是重复的
compile 'com.android.support:multidex:1.0.1'