function patchGradlePropertiesSync() {
  // Read the evn var to check if the new arch is enabled
  let isNewArch;

  if (!process.env.ENABLE_NEW_ARCH) {
    isNewArch = true;
  } else {
    isNewArch = process.env.ENABLE_NEW_ARCH === 'true';
  }

  function readGradlePropertiesFile() {
    const gradlePropertiesFile = path.join(process.cwd(), 'android', 'gradle.properties');
    console.log(`Patching gradle.properties. File: ${gradlePropertiesFile}`);
    const data = fs.readFileSync(gradlePropertiesFile, 'utf8');
    return { gradlePropertiesFile, data };
  }

  function writeGradlePropertiesFile(gradlePropertiesFile, data) {
    const updatedData = data.replace('newArchEnabled=true', 'newArchEnabled=false');
    fs.writeFileSync(gradlePropertiesFile, updatedData, 'utf8');
    console.log('gradle.properties patched successfully.');
  }

  if (!isNewArch) {
    try {
      const { gradlePropertiesFile, data } = readGradlePropertiesFile();
      writeGradlePropertiesFile(gradlePropertiesFile, data);
    } catch (e) {
      console.error('Error:', e);
    }
  }
}
By default gralde.properties has new arch enabled. Disable it by adding evn var