title: Firebase Crashlytics - uploadCrashlyticsSymbolFile, OutOfMemoryError: Java heap space
body: <p>I'm using Firebase Crashlytics to catch my ndk crashes, I've followed this tutorial, so using exactly the same setup. <a href="https://firebase.google.com/docs/crashlytics/ndk-reports" rel="noreferrer">https://firebase.google.com/docs/crashlytics/ndk-reports</a></p>
  
  <pre><code>implementation 'com.google.firebase:firebase-crashlytics-ndk:17.0.0'
  
  classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
  </code></pre>
  
  <p>And</p>
  
  <pre><code>firebaseCrashlytics {
       nativeSymbolUploadEnabled true
  
       strippedNativeLibsDir "build/intermediates/stripped_native_libs/path/out/lib"
       unstrippedNativeLibsDir "build/intermediates/unstripped_native_libs/path/out/lib"
  
  }
  </code></pre>
  
  <p>Since it is heap error I tried</p>
  
  <pre><code> org.gradle.jvmargs=-Xmx14096m
  
   dexOptions.with {
       javaMaxHeapSize = "14g"
   }
  </code></pre>
  
  <p>When I run the <code>uploadCrashlyticsSymbolFileMyAppName</code></p>
  
  <p>Script fails at  <code>app:generateCrashlyticsSymbolFileMyAppDebug</code></p>
  
  <p>My unstripped and stripped libraries is over 80mb I'm sure that is the reason.</p>
  
  <p><strong>Full stacktrace</strong></p>
  
  <pre><code>* What went wrong:
  Execution failed for task ':app:generateCrashlyticsSymbolFileMyAppName'.
  &gt; Java heap space
  
  * 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:generateCrashlyticsSymbolFileMyAppName'.
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:205)
          at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:203)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:184)
          at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
          at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
          at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
          at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
          at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
          at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
          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.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
          at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
          at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
          at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
          at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
          at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
          at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
          at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
          at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
          at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
  Caused by: java.lang.OutOfMemoryError: Java heap space
          at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.interleave(DwarfDataParser.java:355)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.interleaveRanges(DwarfDataParser.java:330)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.processChildDebugInfoEntries(DwarfDataParser.java:285)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.processChildDebugInfoEntries(DwarfDataParser.java:286)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.processCompilationUnit(DwarfDataParser.java:204)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.readCompilationUnit(DwarfDataParser.java:183)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.readCompilationUnit(DwarfDataParser.java:149)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.dwarf.DwarfDataParser.parse(DwarfDataParser.java:73)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.elf.ElfDataParser.parseElf(ElfDataParser.java:132)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.elf.ElfDataParser.parse(ElfDataParser.java:101)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.elf.ElfDataParser.parse(ElfDataParser.java:39)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.csym.ElfCSymFactory.createCSymFromFile(ElfCSymFactory.java:92)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.csym.NdkCSymGenerator.generateCodeMappings(NdkCSymGenerator.java:101)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.csym.NdkCSymGenerator.generateCodeMappings(NdkCSymGenerator.java:90)
          at com.google.firebase.crashlytics.buildtools.ndk.internal.csym.NdkCSymGenerator.generateFromDirectories(NdkCSymGenerator.java:44)
          at com.google.firebase.crashlytics.buildtools.Buildtools.generateSymbolsFromDirectory(Buildtools.java:213)
          at com.google.firebase.crashlytics.buildtools.Buildtools$generateSymbolsFromDirectory$3.call(Unknown Source)
          at com.google.firebase.crashlytics.buildtools.gradle.tasks.GenerateSymbolFileTask.generateSymbols(GenerateSymbolFileTask.groovy:45)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
          at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
  </code></pre>
  
  <p><strong>Similar issue from fabric</strong> </p>
  
  <p><a href="https://stackoverflow.com/questions/57623793/crashlytics-generate-symbols-gradle-step-fails-gc-overhead-limit-exceeded">Crashlytics Generate Symbols gradle step fails: GC Overhead Limit Exceeded</a></p>
  
  <p><a href="https://stackoverflow.com/questions/57931385/error-while-uploading-symbols-to-firebase-crashlytics">Error while uploading symbols to Firebase Crashlytics</a></p>
  
  <p>Github issue is here <a href="https://github.com/firebase/firebase-android-sdk/issues/1588" rel="noreferrer">https://github.com/firebase/firebase-android-sdk/issues/1588</a></p>
  
  <p>Edit : follow the github issue please, we told that that is known bug.</p>