RunTime exception: DexArchiveMergerException: cannot combine dex in Android 3 studio

I am creating a project that uses java lamda expressions and so I recently switched to Android 3. My project builds successfully but throws an exception at runtime as follows: -

Error: execution completed for task ': app: transformDexArchiveWithExternalLibsDexMergerForDebug'. java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: cannot merge dex

Build.gradle project level: -

buildscript { repositories { jcenter() maven { url "https://jitpack.io" } google() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-rc2' } } allprojects { repositories { jcenter() maven { url "https://jitpack.io" } google() } } task clean(type: Delete) { delete rootProject.buildDir } 

Build.gradle application level: -

 apply plugin: 'com.android.application' android { compileSdkVersion 26 buildToolsVersion '26.0.2' defaultConfig { applicationId "com.example.project" minSdkVersion 24 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9' } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android.support.constraint:constraint-layout:1.0.2' implementation 'com.android.support:multidex:1.0.2' implementation project(":app:libs:myfolder") testImplementation 'junit:junit:4.12' 

}

Gradlew output --stacktrace: https://ghostbin.com/paste/3kebt

I tried the clean and rebuild method, and the other methods mentioned in other stackoverflow answers answered a similar question. But nothing works.

Edit: it has already been mentioned that none of the Dex error methods on Android Studio 3.0 Beta4 works in my case, and therefore this is not the same case, and this is not a duplicate question.

So I need help solving this problem. Thanks in advance.

+1
java android dex
Oct 21 '17 at 11:22
source share

No one has answered this question yet.

See similar questions:

41
Dex Error In Android Studio 3.0 Beta4
2
DexArchiveMergerException: Unable to merge dex

or similar:

1345
Where can I place the assets folder in Android Studio?
1214
Rename package in Android Studio
1206
What is Gradle in Android Studio?
288
Unable to merge dex
2
Kotlin cannot compile the library
2
How to display a map on an emulator
0
Powermock does not work in Android Studio
0
Error: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: cannot dex merge
0
Unable to merge dex error in Android Studio when adding a specific compilation depending
0
Failed to sync Gradle project. Basic functionality - failed on Android Studio 2.2



All Articles