Execution failed for task ':gotroute:processDebugResources' - android

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

Related

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 :)

Execution failed for task ':app:transformClassesWithDexBuilderForDebugAndroidTest' java.lang.RuntimeException

I migrated my android project to the AndroidX libraries and I'm having problems running Android tests.
I can compile and run the app with no issues, I can run ./gradlew assembleDebugUnitTest with no issues but it fails to run ./gradlew assembleDebugAndroidTest.
I tried clean/rebuild and invalidating caches and restarting but that didn't work either.
I'm on minSdk=21, compileSdk and targetSdk=28 and buildTools=28.0.3
Here's the full stacktrace, didn't find anything useful in it:
> Task :app:transformClassesWithDexBuilderForDebugAndroidTest FAILED
java.lang.RuntimeException: java.lang.RuntimeException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
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.android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:146)
at com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.getInitalGraphData(DesugarIncrementalTransformHelper.java:162)
at com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.makeDesugaringGraph(DesugarIncrementalTransformHelper.java:130)
at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:160)
at com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.getDependenciesPaths(DesugarIncrementalTransformHelper.java:231)
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.getD8DesugaringCacheInfo(DexArchiveBuilderTransform.java:461)
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.transform(DexArchiveBuilderTransform.java:375)
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.GeneratedMethodAccessor1040.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:131)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
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)
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:317)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
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.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:262)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:246)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:136)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:201)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.executeWithTask(DefaultTaskPlanExecutor.java:192)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.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 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
at org.objectweb.asm.ClassVisitor.visitModule(ClassVisitor.java:148)
at org.objectweb.asm.ClassReader.readModule(ClassReader.java:731)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:632)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:144)
at com.android.builder.desugaring.DesugaringClassAnalyzer.analyzeJar(DesugaringClassAnalyzer.java:92)
at com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:63)
at com.android.build.gradle.internal.transforms.DesugarIncrementalTransformHelper.lambda$getInitalGraphData$4(DesugarIncrementalTransformHelper.java:150)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
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)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebugAndroidTest'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException
Here's my build.gradle file:
apply plugin: "com.android.application"
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
apply from: '../dependencies.gradle'
android {
compileSdkVersion androidCompileSdkVersion
buildToolsVersion androidBuildToolsVersion
defaultConfig {
applicationId "com.domain.app"
minSdkVersion androidMinSdkVersion
targetSdkVersion androidTargetSdkVersion
versionCode appVersionCode
versionName appVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
buildTypes {
debug {
applicationIdSuffix ".debug"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
}
testOptions {
unitTests {
includeAndroidResources true
returnDefaultValues true
}
}
}
dependencies {
final GMS_CORE = "12.0.0"
final INSTALL_REFERER = "1.0"
final HYPERION = "0.9.22"
implementation project(':analytics')
implementation project(':analytics-android')
implementation project(':answer-skill-milestones')
implementation project(":api")
implementation project(":billing")
implementation project(":models")
implementation project(":rxplaybilling")
implementation project(':utilities')
implementation project(':utilities-android')
implementation project(":data")
implementation project(':local-storage')
implementation project(":interactors")
implementation project(':interactors-android')
implementation project(":milestones")
implementation project(":navigation")
implementation project(':premium-process')
implementation project(":dynamic-variables")
implementation project(':facebook')
implementation project(':growing-up')
implementation libraries.androidKtx
implementation libraries.androidXFragment
implementation libraries.ankoCommons
implementation libraries.ankoDesign
implementation libraries.archCore
implementation libraries.archLifecycleExt
kapt libraries.archLifecycleCompiler
implementation libraries.billingClient
implementation libraries.butterknife
kapt libraries.butterknifeCompiler
implementation libraries.calligraphy
implementation libraries.circleImageView
implementation(libraries.crashlytics) { transitive = true }
implementation "com.google.guava:guava:26.0-android"
implementation libraries.kochava
implementation libraries.rxJava2
implementation libraries.rxKotlin
implementation libraries.timber
implementation libraries.kotlin
implementation libraries.dagger2
implementation libraries.dagger2Android
implementation libraries.dagger2AndroidSupport
kapt libraries.dagger2AndroidProcessor
kapt libraries.dagger2Compiler
implementation libraries.exoplayer
implementation libraries.expandableTextView
implementation libraries.facebook
implementation libraries.firebaseCore
implementation libraries.glide
implementation libraries.gson
implementation libraries.imageCropper
implementation libraries.leanplum
implementation libraries.leanplumFcm
implementation libraries.firebaseMsg
implementation libraries.mixpanel
implementation libraries.okhttp
implementation libraries.okhttpLoggingInterceptor
implementation libraries.support
implementation libraries.supportAnimatedVectorDrawable
implementation libraries.supportAnnotations
implementation libraries.supportAppCompat
implementation libraries.supportCardView
implementation libraries.supportConstraintLayout
implementation libraries.supportCustomTabs
implementation libraries.supportDesign
implementation libraries.supportRecyclerView
implementation libraries.recyclerAnimators
implementation libraries.retrofit2
implementation libraries.retrofit2RxJavaAdapter
implementation libraries.retrofit2GsonConverter
implementation libraries.rxAndroid
implementation libraries.rxBinding
implementation libraries.rxBindingKotlin
implementation libraries.rxRelay
implementation "org.checkerframework:checker-compat-qual:2.5.3"
implementation "com.google.errorprone:error_prone_annotations:2.3.1"
testImplementation libraries.androidXFragmentTesting
testImplementation libraries.androidXTestCore
testImplementation libraries.androidXTestEspressoCore
testImplementation libraries.androidXTestEspressoIntents
testImplementation libraries.androidXTestExtJUnit
testImplementation libraries.androidXTestExtTruth
testImplementation libraries.androidXTestRules
testImplementation libraries.androidXTestRunner
testImplementation libraries.junit
testImplementation libraries.mockito
testImplementation libraries.mockitoKotlin
testImplementation libraries.robolectric
testImplementation libraries.robolectricShadowsSupportv4
androidTestImplementation libraries.androidXFragmentTesting
androidTestImplementation libraries.androidXTestCore
androidTestImplementation libraries.androidXTestEspressoCore
androidTestImplementation libraries.androidXTestEspressoIntents
androidTestImplementation libraries.androidXTestExtJUnit
androidTestImplementation libraries.androidXTestExtTruth
androidTestImplementation libraries.androidXTestRules
androidTestImplementation libraries.androidXTestRunner
androidTestImplementation libraries.mockito
androidTestImplementation libraries.mockitoKotlin
androidTestImplementation libraries.robolectric
androidTestImplementation libraries.robolectricShadowsSupportv4
androidTestImplementation "org.checkerframework:checker-compat-qual:2.5.3"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.google.android.gms:play-services-base:$GMS_CORE"
implementation "com.google.android.gms:play-services-gcm:$GMS_CORE"
implementation "com.google.android.gms:play-services-location:$GMS_CORE"
implementation "com.google.android.gms:play-services-ads:$GMS_CORE"
implementation "com.android.installreferrer:installreferrer:$INSTALL_REFERER"
debugImplementation "com.willowtreeapps.hyperion:hyperion-core:$HYPERION"
debugImplementation "com.willowtreeapps.hyperion:hyperion-attr:$HYPERION"
debugImplementation "com.willowtreeapps.hyperion:hyperion-measurement:$HYPERION"
debugImplementation "com.willowtreeapps.hyperion:hyperion-disk:$HYPERION"
debugImplementation "com.willowtreeapps.hyperion:hyperion-recorder:$HYPERION"
debugImplementation "com.willowtreeapps.hyperion:hyperion-phoenix:$HYPERION"
debugImplementation "com.willowtreeapps.hyperion:hyperion-shared-preferences:$HYPERION"
debugImplementation "com.willowtreeapps.hyperion:hyperion-geiger-counter:$HYPERION"
debugImplementation "com.willowtreeapps.hyperion:hyperion-timber:$HYPERION"
}
And the gradle file where all the dependencies and gradle constants are defined:
rootProject.ext {
androidBuildToolsVersion = '28.0.3'
androidCompileSdkVersion = 28
androidMinSdkVersion = 21
androidTargetSdkVersion = 28
appVersionCode = 171
appVersionName = "1.6.0-rc4"
kotlinVersion = "1.2.71"
// ORDERED ALPHABETICALLY.
libraries = [
androidKtx: "androidx.core:core-ktx:1.0.0-alpha1",
androidXFragment: "androidx.fragment:fragment:1.1.0-alpha01",
androidXFragmentTesting: "androidx.fragment:fragment-testing:1.1.0-alpha01",
androidXTestCore: "androidx.test:core:1.0.0-beta01",
androidXTestEspressoCore: "androidx.test.espresso:espresso-core:3.1.0",
androidXTestEspressoIntents: "androidx.test.espresso:espresso-intents:3.1.0",
androidXTestExtJUnit: "androidx.test.ext:junit:1.0.0",
androidXTestExtTruth: "androidx.test.ext:truth:1.0.0",
androidXTestRules: "androidx.test:rules:1.1.0",
androidXTestRunner: "androidx.test:runner:1.1.0",
ankoCommons: "org.jetbrains.anko:anko-commons:0.10.4",
ankoDesign: "org.jetbrains.anko:anko-design:0.10.4",
archCore: "androidx.arch.core:core-runtime:2.0.0-rc01",
archLifecycleExt: "androidx.lifecycle:lifecycle-extensions:2.0.0-rc01",
archLifecycleCompiler: "androidx.lifecycle:lifecycle-compiler:2.0.0-rc01",
billingClient: "com.android.billingclient:billing:1.0",
butterknife: "com.jakewharton:butterknife:9.0.0-SNAPSHOT",
butterknifeCompiler: "com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT",
calligraphy: "com.github.kibotu:Calligraphy:v4.0.1",
circleImageView: "de.hdodenhof:circleimageview:2.1.0",
crashlytics: "com.crashlytics.sdk.android:crashlytics:2.7.1#aar",
dagger2: "com.google.dagger:dagger:2.16",
dagger2Android: 'com.google.dagger:dagger-android:2.16',
dagger2AndroidSupport: 'com.google.dagger:dagger-android-support:2.16',
dagger2AndroidProcessor: 'com.google.dagger:dagger-android-processor:2.16',
dagger2Compiler: "com.google.dagger:dagger-compiler:2.16",
exoplayer: "com.google.android.exoplayer:exoplayer:2.8.2",
expandableTextView: "at.blogc:expandabletextview:1.0.5",
facebook: "com.facebook.android:facebook-android-sdk:4.36.1",
firebaseCore: "com.google.firebase:firebase-core:12.0.0",
firebaseMsg: "com.google.firebase:firebase-messaging:12.0.0",
glide: "com.github.bumptech.glide:glide:4.7.1",
gson: "com.google.code.gson:gson:2.7",
imageCropper: "com.theartofdev.edmodo:android-image-cropper:2.6.0",
junit: "junit:junit:4.12",
kochava: "com.kochava.base:tracker:3.3.1",
kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion",
ktlint: "com.github.shyiko:ktlint:0.29.0",
leanplum: "com.leanplum:leanplum-core:4.2.0",
leanplumFcm: "com.leanplum:leanplum-fcm:4.2.0",
mixpanel: "com.mixpanel.android:mixpanel-android:5.+",
mockito: "org.mockito:mockito-core:2.7.1",
mockitoKotlin: "com.nhaarman.mockitokotlin2:mockito-kotlin:2.0.0-RC1",
okhttp: "com.squareup.okhttp3:okhttp:3.4.1",
okhttpLoggingInterceptor: "com.squareup.okhttp3:logging-interceptor:3.4.1",
recyclerAnimators: "jp.wasabeef:recyclerview-animators:2.2.5",
retrofit2: "com.squareup.retrofit2:retrofit:2.3.0",
retrofit2RxJavaAdapter: "com.squareup.retrofit2:adapter-rxjava2:2.3.0",
retrofit2GsonConverter: "com.squareup.retrofit2:converter-gson:2.3.0",
robolectric: "org.robolectric:robolectric:4.0.2",
robolectricShadowsSupportv4: "org.robolectric:shadows-support-v4:3.0",
rxAndroid: "io.reactivex.rxjava2:rxandroid:2.0.1",
rxBinding: "com.jakewharton.rxbinding2:rxbinding:2.0.0",
rxBindingKotlin: "com.jakewharton.rxbinding2:rxbinding-kotlin:2.0.0",
rxKotlin : "io.reactivex.rxjava2:rxkotlin:2.1.0",
rxJava2 : "io.reactivex.rxjava2:rxjava:2.1.0",
rxRelay: "com.jakewharton.rxrelay2:rxrelay:2.0.0",
support: "androidx.legacy:legacy-support-v4:1.0.0",
supportAnimatedVectorDrawable: "androidx.vectordrawable:vectordrawable-animated:1.0.0",
supportAnnotations: "androidx.annotation:annotation:1.0.0",
supportAppCompat: "androidx.appcompat:appcompat:1.0.2",
supportCardView: "androidx.cardview:cardview:1.0.0",
supportConstraintLayout: "androidx.constraintlayout:constraintlayout:1.1.2",
supportCustomTabs: "androidx.browser:browser:1.0.0",
supportDesign: "com.google.android.material:material:1.0.0-rc01",
supportRecyclerView: "androidx.recyclerview:recyclerview:1.0.0",
timber: "com.jakewharton.timber:timber:4.7.1",
]
}
delete below denpendencies then try it again.
androidTestImplementation libraries.mockito
androidTestImplementation libraries.mockitoKotlin

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

Gson: cannot compile project due to ExclusionStrategy error

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.

Categories

Resources