0

I made an app with rewarded video from appodeal. Everything was ok but something happened and the app stopped compiling with libs from appodeal, with error: Dex merge error. What is going wrong?

logs :

Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. :app:buildInfoDebugLoader :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:checkDebugManifest UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:prepareLintJar UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:createDebugCompatibleScreenManifests UP-TO-DATE :app:processDebugManifest UP-TO-DATE :app:splitsDiscoveryTaskDebug UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources :app:javaPreCompileDebug :app:compileDebugJavaWithJavac :app:mergeDebugShaders UP-TO-DATE :app:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:packageInstantRunResourcesDebug UP-TO-DATE :app:checkManifestChangesDebug :app:transformClassesWithExtractJarsForDebug UP-TO-DATE :app:transformClassesWithInstantRunVerifierForDebug UP-TO-DATE :app:transformClassesWithDependencyCheckerForDebug :app:compileDebugNdk NO-SOURCE :app:mergeDebugJniLibFolders UP-TO-DATE :app:transformNativeLibsWithMergeJniLibsForDebug :app:processDebugJavaRes NO-SOURCE :app:transformResourcesWithMergeJavaResForDebug :app:transformNativeLibsAndResourcesWithJavaResourcesVerifierForDebug :app:transformClassesWithInstantRunForDebug :app:transformClassesEnhancedWithInstantReloadDexForDebug UP-TO-DATE :app:incrementalDebugTasks :app:preColdswapDebug :app:fastDeployDebugExtractor UP-TO-DATE :app:generateDebugInstantRunAppInfo UP-TO-DATE :app:transformClassesWithInstantRunSlicerForDebug UP-TO-DATE :app:transformClassesWithDexBuilderForDebug :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED :app:buildInfoGeneratorDebug

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

Kapil Rajput
  • 11,429
  • 9
  • 50
  • 65
Sarmer
  • 21
  • 1
  • 7

4 Answers4

0

I had the same problem when I updated my google play services.

Here is what solved the problem for me :

  • Clean
  • Rebuild

If that doesn't work try :

  • File -> Invalidate Caches -> Invalidate Caches/Restart

If this didn't work : - Refer to this link it would surely help !!

Ayusch
  • 417
  • 7
  • 17
0

I had the same error. Adding this fixed it

android {
    defaultConfig {
    multiDexEnabled true
                  }
    }
Subhasmith Thapa
  • 884
  • 7
  • 11
0

Ok, so the easiest way for me was just create new project and import everything from project with error and everything become work without any: multiDexEnabled or project clean.

Sarmer
  • 21
  • 1
  • 7
0

Highly likely you have duplicate libs/classes in the project. I suggest you check dependencies in build.gradle, check /libs folder.

Check this out. It also might help you to identify the problem you have.