skip to Main Content

I keep getting this error while trying to build a debug apk for my android app. The app builds and runs on a native device or emulator.

Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform fastutil-8.3.0.jar (it.unimi.dsi:fastutil:8.3.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /Users/kingsleyokoye/.gradle/caches/transforms-3/c6c5e6c867a7a9428e59b7cabb0a5c1a/transformed/jetified-fastutil-8.3.0.jar.
         > Error while dexing.

and If i run with stacktrace, I get a more detailed error message.

> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform fastutil-8.3.0.jar (it.unimi.dsi:fastutil:8.3.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /Users/kingsleyokoye/.gradle/caches/transforms-3/c6c5e6c867a7a9428e59b7cabb0a5c1a/transformed/jetified-fastutil-8.3.0.jar.
         > Error while dexing.

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeExtDexDebug'.
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:408)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:395)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:388)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:374)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
org.gradle.api.internal.file.DefaultFileCollectionFactory$ResolvingFileCollection.visitChildren(DefaultFileCollectionFactory.java:333)
    at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:119)
    at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:330)
    at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:119)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.internal.artifacts.transform.TransformException: Failed to transform fastutil-8.3.0.jar (it.unimi.dsi:fastutil:8.3.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
    at org.gradle.api.internal.artifacts.transform.TransformingAsyncArtifactListener$TransformedArtifact.lambda$visit$2(TransformingAsyncArtifactListener.java:221)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:268)
    at org.gradle.api.internal.artifacts.transform.TransformingAsyncArtifactListener$TransformedArtifact.visit(TransformingAsyncArtifactListener.java:213)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ParallelResolveArtifactSet$VisitingSet$StartVisitAction.visitResults(ParallelResolveArtifactSet.java:99)
org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
    at 
org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.runOperation(DefaultBuildOperationQueue.java:241)
    at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.doRunBatch(DefaultBuildOperationQueue.java:222)
    at org.gradle.internal.operations.DefaultBuildOperationQueue$WorkerRunnable.lambda$runBatch$0(DefaultBuildOperationQueue.java:212)
    at org.gradle.internal.resources.AbstractResourceLockRegistry.whileDisallowingLockChanges(AbstractResourceLockRegistry.java:70)
    at org.gradle.internal.work.DefaultWorkerLeaseService.whileDisallowingProjectLockChanges(DefaultWorkerLeaseService.java:185)
org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50)
    at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)

org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
org.gradle.cache.ManualEvictionInMemoryCache.get(ManualEvictionInMemoryCache.java:30)
    at org.gradle.cache.internal.DefaultCrossBuildInMemoryCacheFactory$CrossBuildCacheRetainingDataFromPreviousBuild.get(DefaultCrossBuildInMemoryCacheFactory.java:259)
    at org.gradle.cache.Cache.get(Cache.java:31)
    at org.gradle.internal.execution.steps.IdentityCacheStep.lambda$executeDeferred$1(IdentityCacheStep.java:47)
    ... 25 more
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/kingsleyokoye/.gradle/caches/transforms-3/c6c5e6c867a7a9428e59b7cabb0a5c1a/transformed/jetified-fastutil-8.3.0.jar:it/unimi/dsi/fastutil/objects/Reference2DoubleMap.class
    at Version.fakeStackEntry(Version_3.0.69.java:0)
    at com.android.tools.r8.utils.w.a(SourceFile:68)
    at com.android.tools.r8.utils.w.a(SourceFile:28)
    at com.android.tools.r8.utils.w.a(SourceFile:27)
    at com.android.tools.r8.utils.w.b(SourceFile:3)
    at com.android.tools.r8.D8.run(D8.java:11)
    at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:115)
    ... 115 more
Caused by: com.android.tools.r8.internal.q8: One or more instruction is preventing default interface method from being desugared: java.lang.Double it.unimi.dsi.fastutil.objects.Reference2DoubleMap.getOrDefault(java.lang.Object, java.lang.Double)
    at com.android.tools.r8.internal.Ei.a(SourceFile:111)
    at com.android.tools.r8.internal.Bi.a(SourceFile:586)
    at com.android.tools.r8.utils.V.a(SourceFile:36)
    at com.android.tools.r8.utils.V.a(SourceFile:41)
    at com.android.tools.r8.utils.V.a(SourceFile:35)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
    at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:321)
    at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:66)
    at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:36)
    at com.android.tools.r8.utils.V.a(SourceFile:34)
    at com.android.tools.r8.internal.sj.a(SourceFile:2)
    at com.android.tools.r8.internal.sj.forEach(SourceFile:2)
    at com.android.tools.r8.utils.V.a(SourceFile:6)
    at com.android.tools.r8.utils.V.a(SourceFile:40)
    at com.android.tools.r8.utils.V.a(SourceFile:38)
    at com.android.tools.r8.utils.V.a(SourceFile:37)
    at com.android.tools.r8.internal.Bi.a(SourceFile:574)
    at com.android.tools.r8.internal.Bi.a(SourceFile:560)
    at com.android.tools.r8.ir.conversion.k.a(SourceFile:12)
    at com.android.tools.r8.ir.conversion.k.a(SourceFile:64)
    at com.android.tools.r8.D8.d(D8.java:39)
    at com.android.tools.r8.D8.b(D8.java:1)
    at com.android.tools.r8.utils.w.a(SourceFile:24)
    ... 118 more
    Suppressed: java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.android.tools.r8.internal.q8: One or more instruction is preventing default interface method from being desugared: java.lang.Double it.unimi.dsi.fastutil.objects.Reference2DoubleMap.getOrDefault(java.lang.Object, java.lang.Double)
        at com.android.tools.r8.D8.d(D8.java:209)
        at com.android.tools.r8.D8.b(D8.java:1)
        at com.android.tools.r8.utils.w.a(SourceFile:24)
        at com.android.tools.r8.utils.w.b(SourceFile:3)
        at com.android.tools.r8.D8.run(D8.java:11)
        at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:115)
        at com.android.build.gradle.internal.dependency.BaseDexingTransform.process(DexingTransform.kt:288)

org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at 
org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:105)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:50)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:86)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:86)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:32)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
        at org.gradle.internal.execution.workspace.impl.DefaultImmutableWorkspaceProvider.lambda$withWorkspace$3(DefaultImmutableWorkspaceProvider.java:120)
        at org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess.withFileLock(LockOnDemandCrossProcessCacheAccess.java:90)
        at org.gradle.cache.internal.DefaultCacheAccess.withFileLock(DefaultCacheAccess.java:191)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.withFileLock(DefaultPersistentDirectoryStore.java:188)
        at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.withFileLock(DefaultCacheFactory.java:209)
        at org.gradle.internal.execution.workspace.impl.DefaultImmutableWorkspaceProvider.withWorkspace(DefaultImmutableWorkspaceProvider.java:117)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)

org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
        at java.base/java.lang.Thread.run(Thread.java:834)
    Caused by: java.util.concurrent.ExecutionException: com.android.tools.r8.internal.q8: One or more instruction is preventing default interface method from being desugared: java.lang.Double it.unimi.dsi.fastutil.objects.Reference2DoubleMap.getOrDefault(java.lang.Object, java.lang.Double)
        at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:566)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:527)
        at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:88)
        at com.android.tools.r8.utils.V.a(SourceFile:11)
        at com.android.tools.r8.utils.V.a(SourceFile:40)
        at com.android.tools.r8.utils.V.a(SourceFile:38)
        at com.android.tools.r8.utils.V.a(SourceFile:37)
        at com.android.tools.r8.internal.Bi.a(SourceFile:574)
        at com.android.tools.r8.internal.Bi.a(SourceFile:560)
        at com.android.tools.r8.ir.conversion.k.a(SourceFile:12)
        at com.android.tools.r8.ir.conversion.k.a(SourceFile:64)
        at com.android.tools.r8.D8.d(D8.java:39)
        ... 126 more
    Caused by: [CIRCULAR REFERENCE: com.android.tools.r8.internal.q8: One or more instruction is preventing default interface method from being desugared: java.lang.Double it.unimi.dsi.fastutil.objects.Reference2DoubleMap.getOrDefault(java.lang.Object, java.lang.Double)]

I’ve tried

  • adding Multidex enabled
  • adding dexOptions {
    javaMaxHeapSize "4g"
    } on my gradle properties file
  • adding implementation ‘com.android.support:multidex:1.0.3’
  • Making sure my dependencies have specified version numbers

But none seems to work.

2

Answers


  1. This might be caused due to 2 problems-

    1. In your gradle.properties file, have you enabled:
        android.useAndroidX=true
        android.enableJetifier=true
    
    1. The jar file might be corrupted. Delete the fastutil-8.3.0.jar file only and let gradle reinstall it.
    Login or Signup to reply.
  2. According to this GitHub ticket there is indeed a problem. Try to roll back the library to an older version (7.2.1 worked for me)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search