[Android] delaysChildPressedState={false} does nothing in a minified release build #4652
Description
Description
On Android, delaysChildPressedState={false} (#4308) has no effect in a release build that R8 minifies, such as the example app's, whose prebuild-generated gradle.properties sets android.enableMinifyInReleaseBuilds=true. A Touchable in that ScrollView still enters its pressed state only after the tap timeout, or on release for a quick tap, exactly like one in a ScrollView that keeps the delay. The same build with minification off honors the option.
NativeViewGestureHandler finds React Native's HasChildPressedStateDelay.setHasChildPressedStateDelay by reflection (NativeViewGestureHandler.kt#L331-L355). R8 renames the interface and keeps none of its methods, since only reflection reaches them: the build's mapping has com.facebook.react.uimanager.HasChildPressedStateDelay -> g12: with no members under it, while the views keep setHasChildPressedStateDelay. So getMethod throws, the setter stays null, and the option is a no-op. gesture-handler ships no ProGuard rule that keeps the interface.
Once the option takes effect, every tap on a button in a keyboardShouldPersistTaps="never" scroll view with the keyboard up is dropped and leaves the keyboard up, which is #4653.
Steps to reproduce
- Render the gist's component, [Native] Add
delaysChildPressedStateto native gesture #4308's test plan withonPressInandonPressOutlogged, in the example app and build it in release, minified as itsgradle.propertiessets it. - Tap the left square (
delaysChildPressedState={false}) withadb shell input tap <x> <y>:onPressInandonPressOutarrive in the same millisecond, andadb logcat -dholdsCan't cancel already finished gesture, on 5 of 5 taps, as on the right square, which keeps the delay. - Hold the left square for 400 ms with
adb shell input swipe <x> <y> <x> <y> 400:onPressOutfollowsonPressInby 298 to 316 ms, as on the right square (243 to 317 ms). - Build again with
-Pandroid.enableMinifyInReleaseBuilds=falseand repeat: a quick tap on the left square leaves no warning, on 5 of 5 taps, and on a 400 ms holdonPressOutfollowsonPressInby 406 to 421 ms. The right square reads as before.
Expected in steps 2 and 3: the left square as in step 4.
Actual: in the minified build the left square times its press like the right one, which keeps the delay. The probe's output, the minified build first:
Five quick taps and five 400 ms holds on each square, minified and unminified, on the API 34 emulator at main b19e233
#### review-delays-child-pressed-state-b19e23310
soft keyboard after opening: hidden
undelayed-touchable at 50 138
quick tap on undelayed-touchable, attempt 1: onPressIn to onPressOut 0 ms, warnings 1
quick tap on undelayed-touchable, attempt 2: onPressIn to onPressOut 0 ms, warnings 1
quick tap on undelayed-touchable, attempt 3: onPressIn to onPressOut 0 ms, warnings 1
quick tap on undelayed-touchable, attempt 4: onPressIn to onPressOut 0 ms, warnings 1
quick tap on undelayed-touchable, attempt 5: onPressIn to onPressOut 0 ms, warnings 1
400ms tap on undelayed-touchable, attempt 1: onPressIn to onPressOut 316 ms, warnings 0
400ms tap on undelayed-touchable, attempt 2: onPressIn to onPressOut 316 ms, warnings 0
400ms tap on undelayed-touchable, attempt 3: onPressIn to onPressOut 322 ms, warnings 0
400ms tap on undelayed-touchable, attempt 4: onPressIn to onPressOut 323 ms, warnings 0
400ms tap on undelayed-touchable, attempt 5: onPressIn to onPressOut 316 ms, warnings 0
delayed-touchable at 210 138
quick tap on delayed-touchable, attempt 1: onPressIn to onPressOut 0 ms, warnings 1
quick tap on delayed-touchable, attempt 2: onPressIn to onPressOut 0 ms, warnings 1
quick tap on delayed-touchable, attempt 3: onPressIn to onPressOut 1 ms, warnings 1
quick tap on delayed-touchable, attempt 4: onPressIn to onPressOut 0 ms, warnings 1
quick tap on delayed-touchable, attempt 5: onPressIn to onPressOut 10 ms, warnings 1
400ms tap on delayed-touchable, attempt 1: onPressIn to onPressOut 316 ms, warnings 0
400ms tap on delayed-touchable, attempt 2: onPressIn to onPressOut 280 ms, warnings 0
400ms tap on delayed-touchable, attempt 3: onPressIn to onPressOut 313 ms, warnings 0
400ms tap on delayed-touchable, attempt 4: onPressIn to onPressOut 315 ms, warnings 0
400ms tap on delayed-touchable, attempt 5: onPressIn to onPressOut 317 ms, warnings 0
#### review-delays-child-pressed-state-b19e23310-unminified
soft keyboard after opening: hidden
undelayed-touchable at 50 138
quick tap on undelayed-touchable, attempt 1: onPressIn to onPressOut 1 ms, warnings 0
quick tap on undelayed-touchable, attempt 2: onPressIn to onPressOut 0 ms, warnings 0
quick tap on undelayed-touchable, attempt 3: onPressIn to onPressOut 0 ms, warnings 0
quick tap on undelayed-touchable, attempt 4: onPressIn to onPressOut 16 ms, warnings 0
quick tap on undelayed-touchable, attempt 5: onPressIn to onPressOut 1 ms, warnings 0
400ms tap on undelayed-touchable, attempt 1: onPressIn to onPressOut 399 ms, warnings 0
400ms tap on undelayed-touchable, attempt 2: onPressIn to onPressOut 418 ms, warnings 0
400ms tap on undelayed-touchable, attempt 3: onPressIn to onPressOut 416 ms, warnings 0
400ms tap on undelayed-touchable, attempt 4: onPressIn to onPressOut 417 ms, warnings 0
400ms tap on undelayed-touchable, attempt 5: onPressIn to onPressOut 416 ms, warnings 0
delayed-touchable at 210 138
quick tap on delayed-touchable, attempt 1: onPressIn to onPressOut 0 ms, warnings 1
quick tap on delayed-touchable, attempt 2: onPressIn to onPressOut 0 ms, warnings 1
quick tap on delayed-touchable, attempt 3: onPressIn to onPressOut 0 ms, warnings 1
quick tap on delayed-touchable, attempt 4: onPressIn to onPressOut 0 ms, warnings 1
quick tap on delayed-touchable, attempt 5: onPressIn to onPressOut 0 ms, warnings 1
400ms tap on delayed-touchable, attempt 1: onPressIn to onPressOut 316 ms, warnings 0
400ms tap on delayed-touchable, attempt 2: onPressIn to onPressOut 299 ms, warnings 0
400ms tap on delayed-touchable, attempt 3: onPressIn to onPressOut 316 ms, warnings 0
400ms tap on delayed-touchable, attempt 4: onPressIn to onPressOut 317 ms, warnings 0
400ms tap on delayed-touchable, attempt 5: onPressIn to onPressOut 316 ms, warnings 0
A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.
https://gist.github.com/YevheniiKotyrlo/249ea819c31b2c35fdbf66ff3006d0af
Gesture Handler version
main at b19e233
React Native version
0.88.0
Platforms
Android
JavaScript runtime
Hermes
Workflow
Using Expo Prebuild or an Expo development build
Build type
Release mode
Device
Android emulator
Device model
API 34 emulator (x86_64, Google APIs), Android 14
Acknowledgements
Yes
Activity
m-bert commentedon Oct 28, 2026
Hi @YevheniiKotyrlo! Should be fixed in #4654, can you confirm that?
YevheniiKotyrlo commentedon Oct 28, 2026
Confirmed, thanks! With #4654,
delaysChildPressedState={false}takes effect in the minified release build.