Gson: cannot compile project due to ExclusionStrategy error - android
I'm taking over a project and it doesn't compile. When I build it, i got the following error:
Program type already present: com.google.gson.ExclusionStrategy
As far as i've seen, no ExclusionStrategy is used within my project. I don't really know how to figure out a solution...
Below is the full error stack.
org.gradle.api.tasks.TaskExecutionException: Execution failed for
task
':sample-mpa-ui:transformDexArchiveWithExternalLibsDexMergerForMyProjectModelDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while
merging dex archives:
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\0.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\1.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\2.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\3.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\4.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\5.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\6.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\7.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\8.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\9.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\10.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\11.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\12.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\13.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\14.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\15.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\16.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\17.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\18.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\19.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\20.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\21.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\22.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\23.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\24.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\25.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\26.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\27.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\28.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\29.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\30.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\31.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\32.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\33.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\34.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\35.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\36.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\37.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\38.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\39.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\40.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\41.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\42.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\43.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\44.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\45.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\46.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\47.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\48.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\49.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\50.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\51.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\52.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\53.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\54.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\55.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\56.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\57.jar
at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:212)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 32 more
Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\0.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\1.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\2.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\3.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\4.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\5.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\6.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\7.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\8.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\9.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\10.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\11.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\12.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\13.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\14.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\15.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\16.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\17.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\18.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\19.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\20.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\21.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\22.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\23.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\24.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\25.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\26.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\27.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\28.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\29.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\30.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\31.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\32.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\33.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\34.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\35.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\36.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\37.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\38.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\39.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\40.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\41.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\42.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\43.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\44.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\45.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\46.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\47.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\48.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\49.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\50.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\51.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\52.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\53.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\54.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\55.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\56.jar,
C:\Sources\MyProject\build\intermediates\transforms\dexBuilder\MyProjectModel\debug\57.jar
at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:124)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:109)
at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:101)
at com.android.build.gradle.internal.transforms.ExternalLibsMergerTransform.transform(ExternalLibsMergerTransform.kt:123)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:221)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:217)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
... 48 more
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:76)
at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:45)
at com.android.tools.r8.D8.run(D8.java:88)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:107)
... 53 more
Caused by: com.android.tools.r8.utils.AbortException
at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:77)
at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:58)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:67)
... 56 more
Below is the project's build.gradle
apply plugin: 'com.android.application'
def app_version = 'v0.0.1'
def version = '0.0.1
android {
compileSdkVersion project.ext.globalCompileSdkVersion
buildToolsVersion project.ext.globalBuildToolsVersion
defaultConfig {
applicationId "com.sample.companyname"
minSdkVersion project.ext.globalMinSdkVersion
targetSdkVersion project.ext.globalTargetSdkVersion
versionCode 74
versionName app_version
multiDexEnabled true
}
compileOptions {
//noinspection GroovyAssignabilityCheck
sourceCompatibility JavaVersion.VERSION_1_7
//noinspection GroovyAssignabilityCheck
targetCompatibility JavaVersion.VERSION_1_7
}
// This has been added to deal with a duplicate file when using
// apache commons-codec and commons-validators
packagingOptions {
pickFirst 'META-INF/DEPENDENCIES.txt'
pickFirst 'META-INF/DEPENDENCIES'
pickFirst 'META-INF/dependencies.txt'
pickFirst 'META-INF/LICENSE.txt'
pickFirst 'META-INF/LICENSE'
pickFirst 'META-INF/license.txt'
pickFirst 'META-INF/LGPL2.1'
pickFirst 'META-INF/NOTICE.txt'
pickFirst 'META-INF/NOTICE'
pickFirst 'META-INF/notice.txt'
}
signingConfigs {
debug {
//noinspection GroovyAssignabilityCheck
storeFile file('../keystore/product.keystore')
storePassword "dont"
keyAlias "even"
keyPassword "try"
}
release {
//noinspection GroovyAssignabilityCheck
storeFile file('../keystore/product.keystore')
storePassword "dont"
keyAlias "even"
keyPassword "try"
}
}
//noinspection GroovyAssignabilityCheck
buildTypes {
debug {
applicationIdSuffix ".debug"
debuggable true
}
release {
debuggable false
minifyEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
flavorDimensions 'tier'
productFlavors {
sampleFlavor1 {
dimension 'tier'
}
sampleFlavor2 {
dimension 'tier'
}
sampleFlavor3 {
dimension 'tier'
}
sampleFlavor4 {
dimension 'tier'
}
}
sourceSets {
main.java.srcDirs = ['src/main/java']
}
lintOptions {
abortOnError false
}
}
//noinspection GroovyAssignabilityCheck
dependencies {
// Project dependencies
implementation project(':module-1')
implementation project(':module-2')
implementation project(':module-3')
implementation project(':module-4')
implementation project(':module-5')
implementation(name: 'lib-a-2.1.1-release', ext: 'aar')
implementation(name: 'lib-b-2.1.1-release', ext: 'aar')
implementation(name: 'lib-c-2.1.1-release', ext: 'aar')
implementation(name: 'lib-d-2.1.1-release', ext: 'aar')
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
implementation('commons-codec:commons-codec:1.10')
implementation('commons-validator:commons-validator:1.4.0') {
exclude group: 'commons-logging', module: 'commons-logging'
exclude group: 'commons-digester', module: 'commons-digester'
exclude group: 'commons-beanutils', module: 'commons-beanutils'
exclude group: 'commons-collections', module: 'commons-collections'
}
implementation "com.google.android.gms:play-services-nearby:$play_services_version"
implementation "com.google.android.gms:play-services-gcm:$play_services_version"
implementation 'com.android.support:multidex:1.0.3'
implementation "com.android.support:appcompat-v7:$support_version"
implementation "com.android.support:design:$support_version"
implementation "com.android.support:support-annotations:$support_version"
implementation "com.android.support.constraint:constraint-layout:1.0.2"
// Test dependencies
androidTestImplementation 'com.squareup.okhttp:mockwebserver:2.3.0'
androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.2.1'
testImplementation 'junit:junit:4.12'
}
Check if you have any gson jar in your lib folder.
I had the same problem and gson-2.2.4.jar in my lib directory.
Removing it worked for me.
Into your app level Build.gradle put a code :-
android {
defaultConfig {
multiDexEnabled true
}
}
See How to implement multiDex
Hope this helps you.
Related
Android build failed. after firebase performance sdk added
environment Android Studio version: 3.4.2 problem When I add apply plugin in gradle, the build failed. I've added a firebase performance sdk according to the guidelines. and, If minify is enabled(buildtype : release), there is no problem the build. However, the build failed when minify is disabled(buildtype : debug). While testing, I founded that the build was successful by removing the line apply plugin: 'com.google.firebase.firebase-perf'. build.gradle(project level) // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { kotlin_version = '1.3.41' nav_version = '2.1.0-alpha05' kodein_version = '6.3.3' debug_drawer_version = '0.7.0' stetho_version = '1.5.0' glide_version = '4.9.0' okhttp3_version = '3.10.0' retrofit_version = '2.6.0' gson_version = '2.8.5' lifecycle_version = '2.2.0-alpha01' } repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.4.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'io.realm:realm-gradle-plugin:5.8.0' classpath 'com.google.gms:google-services:4.3.0' classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" classpath 'com.google.firebase:perf-plugin:1.3.1' } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } build.gradle(app level) apply plugin: 'com.google.firebase.firebase-perf' // if remove this line, build successful apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' apply plugin: 'realm-android' apply from: '../jacoco.gradle' apply plugin: "androidx.navigation.safeargs.kotlin" android { compileSdkVersion 28 buildToolsVersion '28.0.3' useLibrary 'org.apache.http.legacy' defaultConfig { applicationId ... targetSdkVersion 28 minSdkVersion 19 vectorDrawables.useSupportLibrary = true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true } packagingOptions { exclude 'META-INF/LICENSE.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/rxjava.properties' exclude 'META-INF/atomicfu.kotlin_module' exclude 'lib/arm64-v8a/libcardioDecider.so' exclude 'lib/arm64-v8a/libcardioRecognizer.so' exclude 'lib/arm64-v8a/libcardioRecognizer_tegra2.so' exclude 'lib/arm64-v8a/libopencv_core.so' exclude 'lib/arm64-v8a/libopencv_imgproc.so' exclude 'lib/armeabi/libcardioDecider.so' exclude 'lib/armeabi-v7a/libcardioDecider.so' exclude 'lib/armeabi-v7a/libcardioRecognizer.so' exclude 'lib/armeabi-v7a/libcardioRecognizer_tegra2.so' exclude 'lib/armeabi-v7a/libopencv_core.so' exclude 'lib/armeabi-v7a/libopencv_imgproc.so' exclude 'lib/mips/libcardioDecider.so' exclude 'lib/x86/libcardioDecider.so' exclude 'lib/x86/libcardioRecognizer.so' exclude 'lib/x86/libcardioRecognizer_tegra2.so' exclude 'lib/x86/libopencv_core.so' exclude 'lib/x86/libopencv_imgproc.so' exclude 'lib/x86_64/libcardioDecider.so' exclude 'lib/x86_64/libcardioRecognizer.so' exclude 'lib/x86_64/libcardioRecognizer_tegra2.so' exclude 'lib/x86_64/libopencv_core.so' exclude 'lib/x86_64/libopencv_imgproc.so' } dataBinding.enabled = true compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } dexOptions { javaMaxHeapSize "4g" maxProcessCount 8 } kapt { correctErrorTypes = true useBuildCache = true javacOptions { // Increase the max count of errors from annotation processors. // Default is 100. option("-Xmaxerrs", 500) } } lintOptions { abortOnError false } signingConfigs { release { ... } } buildTypes { debug { debuggable true } debugRelease { minifyEnabled true testCoverageEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release matchingFallbacks = ['debug'] } snapshot { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release matchingFallbacks = ['debug'] } release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } } flavorDimensions "region" productFlavors { global { ... } china { ... } } sourceSets { ... } applicationVariants.all { variant -> ... } } def getStoreName(flavorName) { ... } def getDate() { ... } configurations.all { ... } dependencies { // module api project(path: ':base') api project(path: ':entity') implementation fileTree(dir: 'libs', include: ['*.jar']) // AndroidX androidTestImplementation 'androidx.annotation:annotation:1.0.0' androidTestImplementation 'androidx.test:runner:1.1.0' implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.annotation:annotation:1.0.1' implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.percentlayout:percentlayout:1.0.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3' implementation 'androidx.browser:browser:1.0.0' implementation 'androidx.paging:paging-runtime:2.1.0' implementation 'androidx.core:core-ktx:1.0.2' implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" // Kotlin implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.0' // Google Services implementation 'com.google.android.material:material:1.1.0-alpha03' implementation 'com.google.firebase:firebase-core:17.0.1' implementation 'com.google.firebase:firebase-dynamic-links:18.0.0' implementation 'com.google.firebase:firebase-perf:18.0.1' implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.google.android.gms:play-services-base:17.0.0' implementation 'com.google.android.gms:play-services-auth:17.0.0' implementation 'com.google.android.gms:play-services-maps:17.0.0' implementation 'com.google.android.gms:play-services-location:17.0.0' implementation 'com.google.android.gms:play-services-analytics:17.0.0' implementation 'com.google.android.libraries.places:places:2.0.0' // Network Library implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3_version" implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttp3_version" implementation "com.squareup.retrofit2:retrofit:$retrofit_version" implementation "com.squareup.retrofit2:converter-gson:$retrofit_version" implementation "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit_version" implementation('org.apache.httpcomponents:httpmime:4.3.6') { exclude module: 'httpclient' } implementation 'org.apache.httpcomponents:httpclient-android:4.3.5' implementation 'com.android.volley:volley:1.1.1' // Rx2 implementation 'io.reactivex.rxjava2:rxandroid:2.0.2' implementation 'io.reactivex.rxjava2:rxjava:2.1.12' implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0' implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1' implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.1.1' implementation 'com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:2.1.1' // View implementation 'me.grantland:autofittextview:0.2.1' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.wang.avi:library:2.1.3' implementation 'com.facebook.shimmer:shimmer:0.2.0' // Image Loader implementation "com.github.bumptech.glide:glide:$glide_version" // SNS implementation('com.twitter.sdk.android:twitter-core:3.3.0#aar') { transitive = true } // Debug implementation "com.facebook.stetho:stetho:$stetho_version" implementation "com.facebook.stetho:stetho-okhttp3:$stetho_version" implementation 'com.uphyca:stetho_realm:2.2.2' debugImplementation "io.palaima.debugdrawer:debugdrawer:$debug_drawer_version" debugReleaseImplementation "io.palaima.debugdrawer:debugdrawer:$debug_drawer_version" releaseImplementation "io.palaima.debugdrawer:debugdrawer-no-op:$debug_drawer_version" snapshotImplementation "io.palaima.debugdrawer:debugdrawer-no-op:$debug_drawer_version" implementation "io.palaima.debugdrawer:debugdrawer-commons:$debug_drawer_version" // QR Code Reader implementation 'com.journeyapps:zxing-android-embedded:3.6.0' // Test testImplementation 'junit:junit:4.12' testImplementation 'org.mockito:mockito-core:2.23.4' testImplementation 'org.json:json:20180813' testImplementation 'org.testng:testng:6.14.3' // Payment implementation('com.paypal.sdk:paypal-android-sdk:2.16.0') { exclude group: 'io.card' } // Crash Report implementation('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') { transitive = true } // App Rebirth implementation 'com.jakewharton:process-phoenix:2.0.0' // Dependencies Only for Global globalImplementation fileTree(dir: 'src/global/libs', include: ['*.jar']) globalImplementation 'com.google.android.gms:play-services-identity:17.0.0' globalImplementation 'com.google.android.gms:play-services-plus:17.0.0' implementation 'com.facebook.android:facebook-android-sdk:4.34.0' globalImplementation 'com.google.firebase:firebase-messaging:19.0.1' // Dependencies Only For China chinaImplementation fileTree(dir: 'src/china/libs', include: ['*.jar']) chinaImplementation project(':libraries:weiboSDK') chinaImplementation 'com.umeng.analytics:analytics:latest.integration' // china analytics chinaImplementation 'me.pushy:sdk:1.0.27' // Permission implementation 'com.karumi:dexter:4.2.0' implementation 'com.otaliastudios:cameraview:1.6.1' // Logging implementation 'com.jakewharton.timber:timber:4.7.1' implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:9.0.1' // Navigation implementation "androidx.navigation:navigation-fragment:$nav_version" implementation "androidx.navigation:navigation-ui:$nav_version" implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation 'com.appsflyer:af-android-sdk:4.10.0' implementation 'com.android.installreferrer:installreferrer:1.0' } androidExtensions { experimental = true } buildscript { repositories { maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'io.fabric.tools:gradle:1.+' } } repositories { flatDir { dirs 'libs' } jcenter() maven { url 'https://maven.fabric.io/public' } maven { url 'https://github.com/WickeDev/stetho-realm/raw/master/maven-repo' } maven { url 'https://maven.google.com' } } apply plugin: 'com.google.gms.google-services' apply plugin: 'io.fabric' Exception log > Task :app:transformClassesWithMultidexlistForChinaDebug AGPBI: {"kind":"error","text":"Cannot fit requested classes in the main-dex file (# methods: 68027 \u003e 65536)","sources":[{}],"tool":"D8"} > Task :app:transformDexArchiveWithDexMergerForChinaDebug FAILED java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: at sun.reflect.GeneratedConstructorAccessor639.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593) at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677) at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720) at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:407) at com.android.build.gradle.internal.transforms.DexMergerTransform.transform(DexMergerTransform.java:244) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:239) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:235) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102) at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:230) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103) at org.gradle.api.internal.project.taskfactory.IncrementalTaskInputsTaskAction.doExecute(IncrementalTaskInputsTaskAction.java:46) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41) at org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction.java:25) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:401) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:390) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:373) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:79) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:210) at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$0(ExecuteStep.java:32) at java.util.Optional.map(Optional.java:215) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:32) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33) at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39) at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73) at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54) at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35) at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31) at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:201) at org.gradle.internal.execution.steps.CacheStep.executeAndStoreInCache(CacheStep.java:183) at org.gradle.internal.execution.steps.CacheStep.lambda$executeWithCache$2(CacheStep.java:106) at java.util.Optional.orElseGet(Optional.java:267) at org.gradle.internal.execution.steps.CacheStep.lambda$executeWithCache$3(CacheStep.java:106) at org.gradle.internal.Try$1.apply(Try.java:59) at org.gradle.internal.Try$1.apply(Try.java:56) at org.gradle.internal.Try$Success.flatMap(Try.java:102) at org.gradle.internal.Try.map(Try.java:56) at org.gradle.internal.execution.steps.CacheStep.executeWithCache(CacheStep.java:79) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:69) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49) at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43) at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24) at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96) at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89) at java.util.Optional.map(Optional.java:215) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:77) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48) at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:117) at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108) at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67) at org.gradle.api.internal.tasks.execution.StartSnapshotTaskInputsBuildOperationTaskExecuter.execute(StartSnapshotTaskInputsBuildOperationTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:73) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:131) at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:118) at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102) at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:37) at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424) ... 4 more Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:81) at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:45) at com.android.tools.r8.D8.run(D8.java:94) at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:116) ... 7 more Caused by: com.android.tools.r8.utils.AbortException: Error: null, Cannot fit requested classes in the main-dex file (# methods: 68027 > 65536) at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:101) at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:72) at com.android.tools.r8.dex.VirtualFile.throwIfFull(VirtualFile.java:193) at com.android.tools.r8.dex.VirtualFile$DistributorBase.fillForMainDexList(VirtualFile.java:328) at com.android.tools.r8.dex.VirtualFile$FillFilesDistributor.run(VirtualFile.java:380) at com.android.tools.r8.dex.ApplicationWriter.distribute(ApplicationWriter.java:200) at com.android.tools.r8.dex.ApplicationWriter.write(ApplicationWriter.java:221) at com.android.tools.r8.D8.run(D8.java:215) at com.android.tools.r8.D8.lambda$run$1(D8.java:97) at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:62) ... 10 more FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformDexArchiveWithDexMergerForChinaDebug'. > com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: BUILD FAILED in 1m 3s 82 actionable tasks: 12 executed, 70 up-to-date Why is this happening?
It looks like your method count has exceeded that limit for a single dex which frequently occurs on complex apps that include multiple libraries. See this question about multi-dex: What is Android MultiDex?
TaskExecutionException : app:transformClassesWithDexForDebug
I am unable to find where is the issue, i shared my build.gradle file as well Stacktrace: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithDexForDebug'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:54) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:158) at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) ... 17 more Caused by: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:443) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:178) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:174) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156) ... 29 more Caused by: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException at com.android.builder.core.DexByteCodeConverter.dexOutOfProcess(DexByteCodeConverter.java:210) at com.android.builder.core.DexByteCodeConverter.runDexer(DexByteCodeConverter.java:159) at com.android.builder.core.DexByteCodeConverter.convertByteCode(DexByteCodeConverter.java:146) at com.android.builder.core.AndroidBuilder.convertByteCode(AndroidBuilder.java:1422) at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:272) ... 32 more Caused by: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at com.android.builder.core.DexByteCodeConverter.dexOutOfProcess(DexByteCodeConverter.java:206) ... 36 more Caused by: java.lang.UnsupportedOperationException at com.android.ide.common.process.ProcessInfoBuilder$JavaProcessInfoImpl.getExecutable(ProcessInfoBuilder.java:349) at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:74) at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:49) at com.android.builder.core.DexByteCodeConverter.lambda$dexOutOfProcess$1(DexByteCodeConverter.java:196) at java.util.concurrent.FutureTask.run(FutureTask.java:266) ... 3 more build.gradle: repositories { jcenter() maven { url "https://maven.google.com" } } android { compileSdkVersion 26 buildToolsVersion "27.0.2" useLibrary 'org.apache.http.legacy' lintOptions { checkReleaseBuilds false abortOnError false } aaptOptions { cruncherEnabled = false } dexOptions { preDexLibraries = false javaMaxHeapSize "4g" // 2g should be also OK } defaultConfig { minSdkVersion 14 targetSdkVersion 26 multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile files('libs/gcm.jar') compile files('libs/gson-1.7.jar') compile files('libs/acra-4.8.2.jar') compile files('libs/mpandroidchartlibrary-2-2-4.jar') compile files('libs/universal-image-loader-1.8.4-with-sources.jar') compile 'me.relex:circleindicator:1.2.2#aar' compile 'com.google.maps.android:android-maps-utils:0.5+' compile 'com.squareup:android-times-square:1.5.0#aar' //compile fileTree(dir: 'libs', include: ['*.jar']) // circular loader compile 'com.victor:lib:1.0.4' compile ('com.google.code.gson:gson:1.7'){ exclude module: 'support-v4' } compile ('com.astuetz:pagerslidingtabstrip:1.0.1'){ exclude module: 'support-v4' } compile ('com.theartofdev.edmodo:android-image-cropper:2.6.+'){ exclude module: 'support-v4' } compile ('com.google.android.gms:play-services-maps:7.8.0') { exclude module: 'support-v4' } compile ('com.google.android.gms:play-services:7.8.0'){ exclude module: 'support-v4' } compile 'com.android.support:multidex:1.0.0' //compile ('androidx.multidex:multidex:2.0.1') }
Remove your gradle directory folder and sync with gradle files again. Remove folder .gradle Clean project Sync with gradle files Take a breath :)
DexArchiveMergerException while generating signed apk
I have an DexArchiveMergerException when try to build SIGNED android apk. It happens only with signed apk. If I debug app or build not signed apk, everything works well. I've already tried to clean project, invalidate cache and restart, delete build folder, but nothing helps. It's understandable that the thuth is over dependencies. And it's refers to MultiDex. But what particulary I don't know. Can you help me with this please? Here's my build.gradle file: apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 28 defaultConfig { applicationId "com.incubasys.tahlilaty" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" multiDexEnabled true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { debug { buildConfigField "String", "SERVER_PREFIX", "" buildConfigField "String", "SOCKET_SERVER", "" buildConfigField "String", "SOCKET_PROTOCOL", "" debuggable true } release { buildConfigField "String", "SERVER_PREFIX", "" buildConfigField "String", "SOCKET_SERVER", "" buildConfigField "String", "SOCKET_PROTOCOL", "" minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility = '1.8' targetCompatibility = '1.8' } } ext { supportLibraryVersion = "28.0.0" supportMutliDexLibraryVersion = "1.0.3" supportDesignVersion = "1.0.0" constraintLayoutVersion = "1.1.3" flexBoxVersion = "1.0.0" googleGmsServiceVersion = "16.0.1" ciceroneVersion = "4.0.2" rxJavaVersion = "2.1.6" rxAndroidVersion = "2.0.1" daggerVersion = "2.14.1" retrofit2Version = "2.4.0" okhttp3Version = "3.11.0" gsonVersion = "2.8.5" lombokVersion = "1.18.0" androidAnnotationsVersion = "4.5.2" accountKitVersion = "4.34.0" firebaseCoreVersion = "16.0.4" firebaseMessagingVersion = "17.3.4" moxyVersion = "1.5.5" lottieVersion = "2.7.0" timberVersion = "4.7.1" } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "com.android.support:multidex:$supportMutliDexLibraryVersion" implementation "com.android.support:recyclerview-v7:$supportLibraryVersion" implementation "com.android.support:support-v4:$supportLibraryVersion" implementation "com.android.support:appcompat-v7:$supportLibraryVersion" implementation "com.android.support:design:$supportLibraryVersion" implementation "com.android.support.constraint:constraint-layout:$constraintLayoutVersion" implementation "com.google.android:flexbox:$flexBoxVersion" implementation "com.google.android.gms:play-services-auth:$googleGmsServiceVersion" //Cicerone implementation "ru.terrakok.cicerone:cicerone:$ciceroneVersion" // RxJava and RxAndroid implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion" implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion" //Dagger2 kapt "com.google.dagger:dagger-compiler:$daggerVersion" implementation "com.google.dagger:dagger:$daggerVersion" annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion" //Retrofit 2 implementation "com.squareup.retrofit2:retrofit:$retrofit2Version" implementation "com.squareup.retrofit2:converter-gson:$retrofit2Version" implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit2Version" implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3Version" //Gson implementation "com.google.code.gson:gson:$gsonVersion" //Joda implementation group: 'joda-time', name: 'joda-time', version: '2.9.9' // Lombok compileOnly "org.projectlombok:lombok:$lombokVersion" annotationProcessor "org.projectlombok:lombok:$lombokVersion" //AndroidAnnotations annotationProcessor "org.androidannotations:androidannotations:$androidAnnotationsVersion" implementation "org.androidannotations:androidannotations-api:$androidAnnotationsVersion" kapt "org.androidannotations:androidannotations:$androidAnnotationsVersion" //Account Kit implementation "com.facebook.android:account-kit-sdk:$accountKitVersion" //Firebase implementation "com.google.firebase:firebase-core:$firebaseCoreVersion" implementation "com.google.firebase:firebase-messaging:$firebaseMessagingVersion" //Moxy implementation "com.arello-mobile:moxy:$moxyVersion" implementation "com.arello-mobile:moxy-android:$moxyVersion" implementation "com.arello-mobile:moxy-app-compat:$moxyVersion" annotationProcessor "com.arello-mobile:moxy-compiler:$moxyVersion" implementation "com.airbnb.android:lottie:$lottieVersion" // Timber implementation "com.jakewharton.timber:timber:$timberVersion" // EventBus implementation 'org.greenrobot:eventbus:3.1.1' testImplementation 'junit:junit:4.12' } And a project build.gradle: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = '1.2.71' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() mavenCentral() } } task clean(type: Delete) { delete rootProject.buildDir } The error is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDexArchiveWithDexMergerForRelease'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101) at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\0, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\1, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\externalLibsDexMerger\release\0 at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104) at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:212) at sun.reflect.GeneratedMethodAccessor2143.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95) ... 33 more Caused by: com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\0, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\1, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\externalLibsDexMerger\release\0 at com.android.build.gradle.internal.transforms.DexMergerTransform.transform(DexMergerTransform.java:225) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:221) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:217) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102) ... 48 more Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\0, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\1, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\externalLibsDexMerger\release\0 at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinTask.externalAwaitDone(ForkJoinTask.java:326) at java.util.concurrent.ForkJoinTask.doJoin(ForkJoinTask.java:391) at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:719) at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:397) at com.android.build.gradle.internal.transforms.DexMergerTransform.transform(DexMergerTransform.java:221) ... 51 more Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\0, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\dexBuilder\release\1, C:\Android_projects\Tahlilaty\app\build\intermediates\transforms\externalLibsDexMerger\release\0 at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:124) at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:109) at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:101) at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:36) at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424) ... 57 more Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:76) at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:45) at com.android.tools.r8.D8.run(D8.java:67) at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:107) ... 60 more Caused by: com.android.tools.r8.utils.AbortException at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:77) at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:58) at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:67) ... 63 more
The decision was in Lombok library: decreasing version to 1.16.20 solved the problem.
Execution failed for task ':app:transformClassesWithMultidexlistForFreeDebug'
build.gradle(module:app) apply plugin: 'com.android.application' android { compileSdkVersion 27 buildToolsVersion "27.0.3" defaultConfig { applicationId ""com.khaidemsandipsingha.builditbigger"" minSdkVersion 15 targetSdkVersion 27 versionCode 1 versionName "1.0" multiDexEnabled true } buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'LICENSE.txt' } flavorDimensions "tier" productFlavors { paid { applicationId 'com.example.khaidemsandipsingha.builditbigger.paid' versionName '1.0-paid' buildConfigField "boolean", "PAID_VERSION", "true" dimension "tier" } free { applicationId 'com.example.khaidemsandipsingha.builditbigger.free' versionName '1.0-free' buildConfigField "boolean", "PAID_VERSION", "false" dimension "tier" } } sourceSets { main { java.srcDirs = ['src/main/java', 'src/main/java/com.example.khaidemsandipsingha.builditbigger.paid'] } paid { manifest.srcFile 'src/paid/AndroidManifest.xml' } free { manifest.srcFile 'src/free/AndroidManifest.xml' } } repositories { maven { url "https://maven.google.com" } } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') //Tests androidTestImplementation 'org.hamcrest:hamcrest-library:1.3' //Support //noinspection GradleCompatible implementation 'com.android.support:appcompat-v7:27.1.1' // Added for AdMob freeImplementation 'com.google.android.gms:play-services:8.3.0' //Add AndroidJoke implementation project(':androidjoke') //Backend implementation project(path: ':backend', configuration: 'android-endpoints') implementation 'com.google.api-client:google-api-client-android:1.23.0' implementation 'com.google.api-client:google-api-client:1.23.0' implementation 'com.android.support:multidex:1.0.3' } Build error output FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':app:transformClassesWithMultidexlistForFreeDebug'. com.android.build.api.transform.TransformException: Error while generating the main dex list. gradle build -s Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithMultidexlistForFreeDebug'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101) at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46) at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:273) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:258) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: Error while generating the main dex list. at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104) at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:212) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99) ... 31 more Caused by: com.android.build.api.transform.TransformException: Error while generating the main dex list. at com.android.build.gradle.internal.transforms.D8MainDexListTransform.transform(D8MainDexListTransform.kt:127) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:221) at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:217) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102) ... 47 more Caused by: com.android.builder.multidex.D8MainDexList$MainDexListException: com.android.tools.r8.errors.CompilationError: Program type already present: android.support.v4.graphics.drawable.RoundedBitmapDrawable at com.android.builder.multidex.D8MainDexList.generate(D8MainDexList.java:87) at com.android.build.gradle.internal.transforms.D8MainDexListTransform.transform(D8MainDexListTransform.kt:114) ... 50 more Caused by: com.android.tools.r8.errors.CompilationError: Program type already present: android.support.v4.graphics.drawable.RoundedBitmapDrawable at com.android.tools.r8.utils.ProgramClassCollection.resolveClassConflictImpl(ProgramClassCollection.java:64) at com.android.tools.r8.utils.ProgramClassCollection.lambda$create$0(ProgramClassCollection.java:25) at com.android.tools.r8.utils.ProgramClassCollection.create(ProgramClassCollection.java:24) at com.android.tools.r8.graph.LazyLoadedDexApplication$Builder.build(LazyLoadedDexApplication.java:121) at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:122) at com.android.tools.r8.dex.ApplicationReader.read(ApplicationReader.java:86) at com.android.tools.r8.GenerateMainDexList.run(GenerateMainDexList.java:40) at com.android.tools.r8.GenerateMainDexList.run(GenerateMainDexList.java:110) at com.android.builder.multidex.D8MainDexList.generate(D8MainDexList.java:83) ... 51 more GitHub project link: https://github.com/Kurosakicoder/BuildItBiggerGradle-master
what about your application class? if you don't have one, you need to create one and put the name of it in manifest there for your code should be like this AndroidManifest.xml <application android:name="ApplicationName" ... > and your application class will be : public class ApplicationName extends MultiDexApplication{ ..... #Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); } } Update I notice that you use release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.config } this is not working when you run your app in debugging try you export a release if it works then you need to add these configure in a debug build type
Execution failed for task ':gotroute:processDebugResources'
UPDATED: Sorry for my broken English I got this problem for a long time and didn't find a solution. In this app,I got used volleyRequest, Gson, Google Map API, WebView, Spinner, fragment. I got this error when I try to build this app into an Android APK. But I can direct run on emulator device. java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --output /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/transforms/dex/debug/folders/1000/1f/main /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_c68492cc78a3f92f502a1c62cf56d2ed2bec1f55.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_62638f5857b63749284c794ba7208cd9b4711686.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_327d973a322f3d133cf3a04a0e971c09246fd01e.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_267646e7856b1085ab7e87f018cf02c8fef7261b.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_23999158275a87a0a5358d8af2867134aecdf908.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_ce5d1e02e8da052f64b3a4fe50cecfd6f2cbae5f.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_4a2d11953b453238989bfd9a562abde84465124a.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_aac7a56de62db6cb52e1849a37e105199c48c0df.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_75625afee16f6f36d89511459dac089002d10c14.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_c7f0f7ef45a2ecbee3e9dd706d043e2013273fab.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_c344d0729fee21a480151b65a32c3aa41ddf7d18.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_49f18d5c3e88b19a141db05b34550718c6615d18.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_c817043974012b1b4c775d32c95c818523bb0f11.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_badf31927d318fe0767845ee65b13b2611b571f4.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_bc853713f0e84705308c2146f3ce48d6e050920f.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_4e6e23a77da549cd28e7dde3907c5b88e4e9fa45.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_7ba50c8cd2ea3a4fbfa7ca17cd9d8c79d1685d6a.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_5bde0114ba12ae6e92ca40083d5cfbf92fef1412.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/debug_552111fba4f1fea437fe7095e5bffa05307a303a.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_a5182fb65c07623a04053806bac2b69432c366b1.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_ee173547595db43ddfe7a47119b96f4730dd7b38.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_a5b2e9d8d11329be8435d250a5f309d43c0df8fa.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_892e37526af66b272df338cc782668d252864351.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/mongo-java-driver-3.6.1_4542d9cbc62198a8a529e692c7a29b75726a7831.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_24c584efc3346683786de7beff2ab2df3eb682cb.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_be6affcd9af7c361b6354b3f67a49a26e39e0730.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_ab4c7465b09e5551766dea17cd8a6ae4f193a5d7.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_5bf53582c105251c25ab5527a7f964e6a29f075b.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_3221ad30f3e89f3c935e3fa3726a3714a59cebf9.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_18c2aac6ebb68336c3907fed06f28617dd67f315.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_3ceab68fe71d5dfe50c913d9dece9dd24d281346.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_442a6dc716e224e4a223df8ce871959501417345.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_20a1b5248647d33141cd44bbf499ec39a9a7a182.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_608d37e70495d63b55ea7a81891c37c98d18ebae.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_e2d92c8b4a5361ee630750c491ee7c4e1721f997.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_0091c386bd565b2d688657c107c0d409a4d6ac8f.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_9e32b7b1dcf3d39cad0af5c9d052bd5c79695623.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_c8f3115ab85656f0223873a6170d3fa8cd6a056d.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_10e7f1632c3cc11f8eb93c841d4d9f8d4085e6eb.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_acb4591e5bae90b07b49a63e114ff6f1c3917a7b.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_73e23c802bbe08f4bf437d2efd56cc5a32389640.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_ae0f779bc7a6d62aee2168e5bc70664a022c2ce7.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_94ab729a39d746f336e79be75a43a1329e46ecd6.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_7aced6b867d4d2a775c88aaf7cc133bee154364a.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_80cb7978f7b8fc36cc3478ce623d5414f529eda5.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/common-1.0.3_3b9bcfaec1b8cfa7abf2e36506b0e7456d235ecb.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_7cef16af44529b3a1afb314ac500d9197bcd9d21.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_be9b329bc400e38d515d8ae255b83f526359f545.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_dbedffed4f3d1672f955703de8d513d083d06c25.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/common-1.0.0_2706424f64b67787f323ed493a452236e7d95b58.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_a6a95453b073abee42f240b551fa5b22c1307d90.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_3c4d9e89cf704e2e12250dfaf0a46c64950cbf8d.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_28130fe43c2d7b67a42075ce42d62c39a8d1e595.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_a85578d3fdebf5ec7cae61b4e1135022e7c6518e.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_07942a3e0dafecaf065bfe286e590631777ce988.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_a932668bb72ab88a671de2b4089d557a343e8aba.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_4377e963597053ceaf32e2b0935c0c51ae3001ab.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_eb9ebec90843055017e12a632ba9e8c34c762095.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_3b2cec61d5bd5552a3cec482ffdf95af1c6b7e05.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_e4fcf7b495b61d281e7a5581e9ca9dcb772b44d6.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/gson-2.8.2_054c4917edb12ea5b4192ca1ebdef5b2f53b109b.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_690565a916d0884318f98681f109463c3d61fc28.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_ec7d152c7ec8c3e59ad2aecde635601faa42f7da.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/constraint-layout-solver-1.0.2_23781585e34ce5d6bc51da857f31d2bfb3a1a0ca.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_5dc0f4e0c12d03f02a6ea39d88840c92024707b5.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/support-annotations-27.0.2_7cc92c5df8c05b3c1471cf383a236b36be4ae712.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_dd8a06f793cb38641b4d97dc09c2eeb6ccbf0246.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_1bfc6f72859a902939e4500678f6f9aa5d2a064a.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_c19960b8d9d03206da36efbc833cf7957ebb7941.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_a10162c22fb68741382a54c7d4c2ea765c803ebc.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_540d3c9a235de8df1ab74353a3429d38f9f0a80b.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_c24c70e4865375e11d3041a19f25fb9441c779d3.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_86007efb55f9eca6bac1f4fdfba82b40c648c754.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_c92a3bbb8a9b200a4f01c4bdaaadf49d7d947556.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_38c2f750331a674c1cd4a9d7cd7404483b4875d3.jar /home/gibson/WorkPlace/SoftwareProject/2017_ITSE_HandsomeLee/BaseProject-master/gotroute/build/intermediates/pre-dexed/debug/classes_618561d0d7659df1a1dc8e8fcfde6b2152d356b5.jar} at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104) at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163) at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134) at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.execute(ExecuteActionsTaskExecuter.java:115) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.execute(ExecuteActionsTaskExecuter.java:109) at org.gradle.internal.Transformers$4.transform(Transformers.java:169) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:109) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:90) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:68) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46) at ............. This is my gradle build: apply plugin: 'com.android.application' android { compileSdkVersion 27 buildToolsVersion "27.0.1" defaultConfig { applicationId "com.handsomelee.gotroute" minSdkVersion 23 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } productFlavors { } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:27.+' compile 'com.android.support:design:+' compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.google.android.gms:play-services-maps:11.4.2' testCompile 'junit:junit:4.12' compile 'com.google.android.gms:play-services-ads:11.0.4' compile 'org.mongodb:mongo-java-driver:+' compile 'com.mcxiaoke.volley:library-aar:1.0.0' compile 'com.google.code.gson:gson:2.8.2' compile 'com.github.evgenyneu:js-evaluator-for-android:v4.0.0' } Please give me some method to fix this bug Thanks