From 91f920ed7efc3850c5bcaa6e6afd2e12d0a05f12 Mon Sep 17 00:00:00 2001 From: Dennis Falling Date: Fri, 12 Jun 2026 23:16:57 +0100 Subject: [PATCH] Speed up screen transitions and fix local builds on JDK 25 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stack transitions felt sluggish: react-native-screens hardcodes Android slide animations to config_mediumAnimTime (400ms) and ignores react-navigation's animationDuration on Android. Override the four rns_slide_* anim resources in the app module (resource merging beats the library's copies) to run at 150ms. Also fix `bun run android` failing at configureCMake on JDK 25: AGP's forked prefab CLI triggers the JEP 472 restricted-method warning via JNA, and AGP treats any unrecognized prefab stderr as fatal. Set JAVA_TOOL_OPTIONS=--enable-native-access=ALL-UNNAMED in mise.toml's [env] — AGP whitelists the resulting "Picked up" line — until the upstream fix (b/469503601) ships in an AGP release. Co-Authored-By: Claude Fable 5 --- android/app/src/main/res/anim/rns_slide_in_from_left.xml | 6 ++++++ .../app/src/main/res/anim/rns_slide_in_from_right.xml | 9 +++++++++ android/app/src/main/res/anim/rns_slide_out_to_left.xml | 6 ++++++ android/app/src/main/res/anim/rns_slide_out_to_right.xml | 6 ++++++ mise.toml | 9 +++++++++ src/navigation/RootNavigator.tsx | 4 ++++ 6 files changed, 40 insertions(+) create mode 100644 android/app/src/main/res/anim/rns_slide_in_from_left.xml create mode 100644 android/app/src/main/res/anim/rns_slide_in_from_right.xml create mode 100644 android/app/src/main/res/anim/rns_slide_out_to_left.xml create mode 100644 android/app/src/main/res/anim/rns_slide_out_to_right.xml diff --git a/android/app/src/main/res/anim/rns_slide_in_from_left.xml b/android/app/src/main/res/anim/rns_slide_in_from_left.xml new file mode 100644 index 0000000..aaba142 --- /dev/null +++ b/android/app/src/main/res/anim/rns_slide_in_from_left.xml @@ -0,0 +1,6 @@ + + + diff --git a/android/app/src/main/res/anim/rns_slide_in_from_right.xml b/android/app/src/main/res/anim/rns_slide_in_from_right.xml new file mode 100644 index 0000000..39c5554 --- /dev/null +++ b/android/app/src/main/res/anim/rns_slide_in_from_right.xml @@ -0,0 +1,9 @@ + + + diff --git a/android/app/src/main/res/anim/rns_slide_out_to_left.xml b/android/app/src/main/res/anim/rns_slide_out_to_left.xml new file mode 100644 index 0000000..dc79333 --- /dev/null +++ b/android/app/src/main/res/anim/rns_slide_out_to_left.xml @@ -0,0 +1,6 @@ + + + diff --git a/android/app/src/main/res/anim/rns_slide_out_to_right.xml b/android/app/src/main/res/anim/rns_slide_out_to_right.xml new file mode 100644 index 0000000..5ea49b2 --- /dev/null +++ b/android/app/src/main/res/anim/rns_slide_out_to_right.xml @@ -0,0 +1,6 @@ + + + diff --git a/mise.toml b/mise.toml index 391ce89..89fa444 100644 --- a/mise.toml +++ b/mise.toml @@ -9,3 +9,12 @@ node = "24" bun = "1.3.14" java = "temurin-25.0.3+9.0.LTS" + +[env] +# On JDK 24+ the JVM warns on stderr when JNA calls System::load (JEP 472). +# AGP forks the prefab CLI during configureCMake* and fails the build on any +# unrecognized stderr line, so the warning breaks `bun run android`. AGP does +# whitelist the "Picked up JAVA_TOOL_OPTIONS" line, making this env var the +# supported way to grant native access in forked JVMs until the AGP fix +# (issuetracker b/469503601) ships in a release. +JAVA_TOOL_OPTIONS = "--enable-native-access=ALL-UNNAMED" diff --git a/src/navigation/RootNavigator.tsx b/src/navigation/RootNavigator.tsx index a66d4fe..f721a72 100644 --- a/src/navigation/RootNavigator.tsx +++ b/src/navigation/RootNavigator.tsx @@ -11,6 +11,10 @@ const Stack = createNativeStackNavigator(); * The authenticated app's screen stack. Headers are hidden — each screen draws * its own chrome edge-to-edge and applies its own safe-area padding. The detail * screen slides in from the right as a standard forward push. + * + * Transition speed: react-navigation's `animationDuration` option is a no-op on + * Android, so the slide duration is set by overriding react-native-screens' + * anim resources in android/app/src/main/res/anim/rns_slide_*.xml. */ export function RootNavigator() { return (