From c43b913dded1ab4a61ad92198e589f4625f4fba4 Mon Sep 17 00:00:00 2001 From: billisdead Date: Mon, 22 Jun 2026 15:16:37 +0200 Subject: [PATCH] fix: exclude reanimated/worklets native build, disable New Architecture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit react-native.config.js excludes react-native-reanimated and react-native-worklets from Android native linking — neither is used in the app and react-native-gesture-handler has a dedicated noreanimated codepath for exactly this case. build-apk.sh step 4.6 forces newArchEnabled=false in gradle.properties after expo prebuild, as a fallback for New Architecture init issues on Android 15. Co-Authored-By: Claude Sonnet 4.6 --- build-apk.sh | 10 ++++++++++ react-native.config.js | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 react-native.config.js diff --git a/build-apk.sh b/build-apk.sh index f5256bb..bc92ee7 100755 --- a/build-apk.sh +++ b/build-apk.sh @@ -93,6 +93,16 @@ if [ -f "$REANIMATED_CMAKE" ] && ! grep -q "max-page-size" "$REANIMATED_CMAKE"; info "Patched react-native-reanimated for 16KB pages" fi +# ─── 4.6. Disable New Architecture (Android 15 compat) ──────────────────── +GRADLE_PROPS_NEWARCH="$SCRIPT_DIR/android/gradle.properties" +if [ -f "$GRADLE_PROPS_NEWARCH" ]; then + sed -i 's/^newArchEnabled=true/newArchEnabled=false/' "$GRADLE_PROPS_NEWARCH" + if ! grep -q "^newArchEnabled=" "$GRADLE_PROPS_NEWARCH"; then + echo "newArchEnabled=false" >> "$GRADLE_PROPS_NEWARCH" + fi + info "New Architecture disabled in gradle.properties" +fi + # ─── 5. Patch build.gradle — inject release signingConfig ────────────────── info "Patching android/app/build.gradle for release signing…" diff --git a/react-native.config.js b/react-native.config.js new file mode 100644 index 0000000..7d5d44e --- /dev/null +++ b/react-native.config.js @@ -0,0 +1,13 @@ +// Exclude native build for packages not used in this project. +// react-native-gesture-handler detects their absence and falls back to its +// noreanimated codepath, so GestureHandlerRootView continues to work. +module.exports = { + dependencies: { + 'react-native-reanimated': { + platforms: { android: null }, + }, + 'react-native-worklets': { + platforms: { android: null }, + }, + }, +};