Increasing Android build memory in React Native

how to increase Android build heap size

Android build system has a maximum heap size of 1280MB by default. When you add a lot of modules like Firebase default memory size will not work. To avoid errors during the builds. you need to uncomment the Gradle memory setting in /android/gradle.properties:

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

if you wish you can increase more and get better performance during the builds.