title: Failed To Build Android Application After Adding Firebase Libs
body: <p>Hi I Need help i have created a new android app now i want to implement firebase Notifications on it.
  But After Adding The Libs. I am not able to build i am getting the following Error
  But My Application Is Working Fine Only i Am not able to Build it.</p>
  
  <p><strong>please help me to Resolve this problem</strong></p>
  
  <pre><code>Task :app:transformClassesWithDexBuilderForDebug
  AGPBI: {"kind":"error","text":"Cannot fit requested classes in a single dex file (# methods: 127989 \u003e 65536 ; # fields: 66243 \u003e 65536)","sources":[{}],"tool":"D8"}
  
  &gt; Task :app:mergeDexDebug
  java.lang.RuntimeException: java.lang.RuntimeException: 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 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.build.gradle.internal.tasks.DexMergingTaskDelegate.run(DexMergingTask.kt:316)
      at com.android.build.gradle.internal.tasks.DexMergingTask.taskAction(DexMergingTask.kt:132)
      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.StandardTaskAction.doExecute(StandardTaskAction.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.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:801)
      at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:768)
      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)
      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)
  </code></pre>
  
  <p>java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
      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 <a href="https://developer.android.com/tools/building/multidex.html" rel="noreferrer">https://developer.android.com/tools/building/multidex.html</a>
          at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:131)
          at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:118)
          at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102)
          at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:37)
          at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)</p>
  
  <pre><code>    &gt; Task :app:mergeDexDebug FAILED
  
      FAILURE: Build failed with an exception.
  
      * What went wrong:
      Execution failed for task ':app:mergeDexDebug'.
      &gt; com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: 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
  
      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  
      * Get more help at https://help.gradle.org
  
      BUILD FAILED in 2m 41s
      20 actionable tasks: 9 executed, 11 up-to-date
  </code></pre>