Skip to main content
Version: 0.72

Troubleshooting

caution

This documentation is still experimental and details are subject to changes as we iterate. Feel free to share your feedback on the discussion inside the working group for this page.

Moreover, it contains several manual steps. Please note that this won't be representative of the final developer experience once the New Architecture is stable. We're working on tools, templates and libraries to help you get started fast on the New Architecture, without having to go through the whole setup.

This page contains resolutions to common problem you might face when migrating to the New Architecture.

CocoaPods and Node Reset​

The CocoaPods integration will see frequent updates as we rollout the New Architecture, and it is possible to end up with your workspace in a broken state after one of these changes. You may clean up any changes related to the codegen by performing some of these steps:

  1. Run bundle exec pod deintegrate in your ios directory and then rerun RCT_NEW_ARCH_ENABLED=1 bundle exec pod install.
  2. Delete node_modules and re-run yarn install.

Android build is failing with OutOfMemoryException​

If your Android Gradle builds are failing with: OutOfMemoryException: Out of memory: Java heap space. or similar errors related to low memory, you might need to increase the memory allocated to the JVM.

You can do that by editing the gradle.properties file in your android/gradle.properties folder:

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

Make sure to uncomment the line and set the preferred memory size with the -Xmx parameter. 2Gb should be the minimum required and 4Gb is recommended.

Android NDK and Mac with M1 Apple Silicon CPUs​

We're aware of a series of incompatibilities between the Android NDK and Macs on M1 CPUs (here and here). As the New Architectecture relies on the NDK, you might face problems during your build.

React Native version 0.70 and 0.71 contains fixes for those build failures, and we invite you to update to those versions whenever possible.