From eb563006c5f3d4ab01b6e87d8c26af32d2dd8eb2 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Tue, 27 Feb 2024 13:37:45 -0800 Subject: [PATCH] android build: Update jsBundleDirRelease for AGP 7.1+, fixing crash on startup This is a new incarnation of the same underlying React Native issue seen in 8f8a266af and 833d083a9, back in 2019 and 2018 respectively. RN hard-codes what intermediate directory it expects the Android Gradle Plugin to look for assets in; but that directory isn't any kind of stable API, and in fact it changes from time to time in new versions of AGP. It changed again in AGP 7.1.0. More recent versions of RN know about this latest change (with yet another hardcoding, conditioned on a new range of AGP versions): https://github.com/facebook/react-native/pull/33057 But ours doesn't, because we haven't been updating RN for a while in this legacy codebase. So just update the directory we force it to. See discussion: https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/release.20build.20missing.20JS.20bundle/near/1746718 [greg: expanded commit message] --- android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 49145ef67e5..2298d1ffcfe 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -79,7 +79,7 @@ apply plugin: "kotlin-android-extensions" project.ext.react = [ enableHermes : false, // clean and rebuild if changing // quasi-unstable: see commits 8f8a266af and 833d083a9 - jsBundleDirRelease: "$buildDir/intermediates/merged_assets/release/out" + jsBundleDirRelease: "$buildDir/intermediates/assets/release/mergeReleaseAssets" ] apply from: "../../node_modules/react-native/react.gradle"