skip to Main Content

someone can help me with this.

When i add this dependences to my flutter project

 provider: ^6.0.5
  shared_preferences: ^2.2.2
  flutter_signin_button: ^2.0.0
  flutter_spinkit: ^5.2.0
  sign_in_with_apple: ^5.0.0
  google_sign_in: ^6.1.5
  firebase_auth: ^4.10.1
  cloud_firestore: ^4.9.3
  money_formatter: ^0.0.5
  permission_handler: ^11.0.1
  contacts_service: ^0.6.3
  flutter_staggered_animations: ^1.1.1
  flutter_typeahead: ^4.8.0
  intl: ^0.18.1
  timeago: ^3.5.0
  auto_animated: ^3.2.0

and then i try to run i got this error

[  +25 ms] ERROR:D8: Cannot fit requested classes in a single dex file (# methods: 106458 > 65536)
[   +6 ms] com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
[   +1 ms] The number of method references in a .dex file cannot exceed 64K.
[   +3 ms] Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
[   +1 ms]      at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:151)
[   +1 ms]      at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:138)
[   +1 ms]      at com.android.build.gradle.internal.tasks.DexMergingWorkAction.merge(DexMergingTask.kt:859)
[        ]      at com.android.build.gradle.internal.tasks.DexMergingWorkAction.run(DexMergingTask.kt:805)
[        ]      at com.android.build.gradle.internal.profile.ProfileAwareWorkAction.execute(ProfileAwareWorkAction.kt:74)
[        ]      at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
[        ]      at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
[   +1 ms]      at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
[        ]      at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
[   +1 ms]      at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
[        ]      at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
[        ]      at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
[        ]      at
org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) 
[   +1 ms]      at
org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) 
[   +1 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
[        ]      at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
[   +1 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
[   +1 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
[   +1 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
[   +1 ms]      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
[   +1 ms]      at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
[   +1 ms]      at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
[   +1 ms]      at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:205)
[   +1 ms]      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[        ]      at
org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)     
[   +1 ms]      at
org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)       
[   +1 ms]      at
org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)
[   +1 ms]      at org.gradle.internal.Factories$1.create(Factories.java:31)
[   +1 ms]      at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249)
[   +1 ms]      at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109)
[   +1 ms]      at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:114)
[   +1 ms]      at
org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)
[   +1 ms]      at
org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)
[   +1 ms]      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[   +1 ms]      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[   +1 ms]      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
[   +1 ms]      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
[   +1 ms]      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[   +1 ms]      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[   +3 ms]      at java.base/java.lang.Thread.run(Thread.java:833)
[   +1 ms] Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, position: null
[   +1 ms]      at Version.fakeStackEntry(Version_3.3.70.java:0)
[   +1 ms]      at com.android.tools.r8.internal.Fj.a(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:75)  
[   +1 ms]      at com.android.tools.r8.internal.Fj.a(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:28)  
[   +1 ms]      at com.android.tools.r8.internal.Fj.a(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:27)  
[   +1 ms]      at com.android.tools.r8.internal.Fj.b(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:2)   
[   +1 ms]      at com.android.tools.r8.D8.run(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:11)
[   +2 ms]      at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:136)
[   +1 ms]      ... 38 more
[   +1 ms] Caused by: com.android.tools.r8.internal.f: Cannot fit requested classes in a single dex file (# methods: 106458 > 65536)  
[   +1 ms]      at com.android.tools.r8.internal.JT.a(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:14)
[   +1 ms]      at com.android.tools.r8.internal.JT.a(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:22)  
[   +1 ms]      at com.android.tools.r8.internal.n30.a(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:524)
[   +1 ms]      at com.android.tools.r8.internal.i30.a(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:7)  
[   +1 ms]      at com.android.tools.r8.internal.F2.a(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:371) 
[   +1 ms]      at com.android.tools.r8.internal.F2.a(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:455) 
[   +1 ms]      at com.android.tools.r8.D8.d(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:756)
[   +1 ms]      at com.android.tools.r8.D8.b(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:1)
[   +1 ms]      at com.android.tools.r8.internal.Fj.a(R8_3.3.70_49b71801b8b3de79ea68cec3bf950786c8f90f7a560cea4a2d23a82079b17d04:24)  
[   +1 ms]      ... 41 more
[   +2 ms] FAILURE: Build failed with an exception.
[   +1 ms] * What went wrong:
[   +1 ms] Execution failed for task ':app:mergeExtDexDebug'.
[   +1 ms] > A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate
[   +1 ms]    > There was a failure while executing work items
[   +1 ms]       > A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingWorkAction
[   +1 ms]          > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
[        ]            The number of method references in a .dex file cannot exceed 64K.
[        ]            Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
[   +1 ms] * Try:
[   +1 ms] > Run with --debug option to get more log output.
[   +1 ms] > Run with --scan to get full insights.
[   +1 ms] * Exception is:
[        ] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeExtDexDebug'.
[        ]      at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:142)       
[   +1 ms]      at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
[        ]      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:140)
[   +1 ms]      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:128)    
[   +1 ms]      at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)   
[   +1 ms]      at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
[   +1 ms]      at
org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
[   +2 ms]      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
[   +1 ms]      at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
[   +1 ms]      at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)     
[   +1 ms]      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)     
[   +1 ms]      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)
[   +1 ms]      at
org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) 
[   +1 ms]      at
org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) 
[   +1 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
[   +2 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
[   +2 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
[   +1 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
[        ]      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
[   +1 ms]      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
[   +1 ms]      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
[   +1 ms]      at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:69)
[   +1 ms]      at
org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:327)        
[   +1 ms]      at
org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:314)        
[   +1 ms]      at
org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:307
)
[   +1 ms]      at
org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:293
)
[   +1 ms]      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:417)
[   +1 ms]      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:339)
[        ]      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
[   +1 ms]      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
[        ]      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[   +1 ms]      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[        ]      at java.base/java.lang.Thread.run(Thread.java:833)
[        ] Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing    
com.android.build.gradle.internal.tasks.DexMergingTaskDelegate
[   +1 ms]      at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:207)
[   +3 ms]      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[        ]      at
org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)     
[   +1 ms]      at
org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)       
[   +2 ms]      at
org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)
[   +1 ms]      at org.gradle.internal.Factories$1.create(Factories.java:31)
[   +1 ms]      at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249)
[   +1 ms]      at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109)
[        ]      at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:114)
[   +1 ms]      at
org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)
[   +1 ms]      at
org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)
[   +1 ms]      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[   +1 ms]      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[        ]      at 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:1136)
[   +1 ms]      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[   +2 ms]      at java.base/java.lang.Thread.run(Thread.java:833)
[   +1 ms] Caused by: org.gradle.workers.WorkerExecutionException: There was a failure while executing work items
[   +1 ms]      at org.gradle.workers.internal.DefaultWorkerExecutor.workerExecutionException(DefaultWorkerExecutor.java:267)
[   +1 ms]      at org.gradle.workers.internal.DefaultWorkerExecutor.await(DefaultWorkerExecutor.java:249)
[        ]      at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:72)
[   +1 ms]      at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
[        ]      at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
[        ]      at
org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) 
[   +1 ms]      at
org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) 
[   +1 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
[   +1 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
[        ]      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
[   +1 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
[   +3 ms]      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
[   +4 ms]      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
[        ]      at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
[        ]      at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
[        ]      at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:205)
[        ]      ... 17 more
[        ] Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing    
com.android.build.gradle.internal.tasks.DexMergingWorkAction
[   +2 ms]      at org.gradle.workers.internal.DefaultWorkerExecutor$WorkItemExecution.waitForCompletion(DefaultWorkerExecutor.java:339)
[   +2 ms]      at
org.gradle.internal.work.DefaultAsyncWorkTracker.lambda$waitForItemsAndGatherFailures$2(DefaultAsyncWorkTracker.java:130)
[   +1 ms]      at org.gradle.internal.Factories$1.create(Factories.java:31)
[   +1 ms]      at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLocks(DefaultWorkerLeaseService.java:321)
[   +1 ms]      at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLocks(DefaultWorkerLeaseService.java:304)
[        ]      at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLock(DefaultWorkerLeaseService.java:309)
[   +1 ms]      at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:126)
[   +1 ms]      at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:88)    
[   +1 ms]      at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForAll(DefaultAsyncWorkTracker.java:78)
[        ]      at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForCompletion(DefaultAsyncWorkTracker.java:66)
[   +1 ms]      at org.gradle.workers.internal.DefaultWorkerExecutor.await(DefaultWorkerExecutor.java:247)
[        ]      ... 31 more
[   +1 ms] Caused by: com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveMergerException: Error 
while merging dex archives: 
[   +1 ms] The number of method references in a .dex file cannot exceed 64K.
[   +1 ms] Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
[   +1 ms]      at com.android.build.gradle.internal.tasks.DexMergingWorkAction.merge(DexMergingTask.kt:872)
[   +1 ms]      at com.android.build.gradle.internal.tasks.DexMergingWorkAction.run(DexMergingTask.kt:805)
[   +1 ms]      at com.android.build.gradle.internal.profile.ProfileAwareWorkAction.execute(ProfileAwareWorkAction.kt:74)
[        ]      at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
[        ]      at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
[        ]      at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
[   +1 ms]      at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
[        ]      at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
[   +1 ms]      ... 30 more
[        ] Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
[        ] The number of method references in a .dex file cannot exceed 64K.
[        ] Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
[        ]      at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:151)
[        ]      at 

I already tried to update java and my environment variables but the error persists, if I create a new flutter project it compiles correctly without the dependencies but when I add them it returns that error

2

Answers


  1. Add this to android/app/build.gradle:

    android {
        defaultConfig {
            ...
            multiDexEnabled true
        }
        ...
    }
    
    dependencies {
      implementation 'com.android.support:multidex:2.0.1'
    }
    
    Login or Signup to reply.
  2. You can check this Android Documentation about multidex, all you do is just edit the gradle file at app level (android/app/build.gradle) then set the multidex to ‘true’ like this

    android {
        defaultConfig {
            ...
            multiDexEnabled true
        }
        ...
    }
    
    dependencies {
        implementation "androidx.multidex:multidex:2.0.1"
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search