facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.3k stars 24.35k forks source link

Crash on scrolling inside <Animated.Scrollview ../> : java.lang.NoSuchMethodError: No virtual method reversed() #45178

Closed ram95krishh closed 4 months ago

ram95krishh commented 4 months ago

Description

App crashes whenever we scroll inside a Animed.ScrollView that uses React Native Gesture Handler. Not sure if the issue is directly related react-native or react-native-gesture-handler, hence raising an issue in both repos.. Please upvote (👍) or comment if anybody else is also facing this since the app:checkDevelopmentRechargeDebugAarMetadata step started mandating projects to start supporting compileSdkVersion 35 (for Android VanillaIceCream)

react-native-gesture-handler version 2.14.0

Steps to reproduce

App crashes whenever scrolled inside such scroll views.

const MyComponent = () => {
  const scrollY = useAnimatedValue()
  return (
    <Animated.ScrollView
      onScroll={Animated.event(
        [{ nativeEvent: { contentOffset: { y: scrollY } } }],
        { useNativeDriver: true }
      )}
    >
      {content}
   </Animated.ScrollView>
  )
}

React Native Version

0.73.8

Affected Platforms

Runtime - Android

Output of npx react-native info

WARNING: You should run npx react-native@latest to ensure you're always using the most current version of the CLI. NPX has cached version (0.73.8) != current release (0.74.2)

info Fetching system and libraries information...
System:
  OS: macOS 14.3.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 180.91 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.2
    path: /opt/homebrew/opt/node@18/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.5.0
    path: /opt/homebrew/opt/node@18/bin/npm
  Watchman:
    version: 2024.04.15.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11668458
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /opt/homebrew/opt/openjdk@17/bin/javac
  Ruby:
    version: 3.3.0
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.8
    wanted: 0.73.8
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

info React Native v0.74.2 is now available (your project is running on v0.73.8).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.74.2
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.2
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Stacktrace or Logs

java.lang.NoSuchMethodError: No virtual method reversed()Ljava/util/List; in class Ljava/util/ArrayList; or its super classes (declaration of 'java.util.ArrayList' appears in /apex/com.android.art/javalib/core-oj.jar)
at com.swmansion.gesturehandler.core.GestureHandlerOrchestrator.makeActive(GestureHandlerOrchestrator.kt:193)
at com.swmansion.gesturehandler.core.GestureHandlerOrchestrator.tryActivate(GestureHandlerOrchestrator.kt:102)
at com.swmansion.gesturehandler.core.GestureHandlerOrchestrator.onHandlerStateChange(GestureHandlerOrchestrator.kt:154)
at com.swmansion.gesturehandler.core.GestureHandler.moveToState(GestureHandler.kt:568)
at com.swmansion.gesturehandler.core.GestureHandler.activate(GestureHandler.kt:671)
at com.swmansion.gesturehandler.core.GestureHandler.activate(GestureHandler.kt:667)
at com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper.tryCancelAllHandlers(RNGestureHandlerRootHelper.kt:112)
at com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper.requestDisallowInterceptTouchEvent(RNGestureHandlerRootHelper.kt:93)
at com.swmansion.gesturehandler.react.RNGestureHandlerRootView.requestDisallowInterceptTouchEvent(RNGestureHandlerRootView.kt:47)
at android.view.ViewGroup.requestDisallowInterceptTouchEvent(ViewGroup.java:3244)
at android.view.ViewGroup.requestDisallowInterceptTouchEvent(ViewGroup.java:3244)
at android.view.ViewGroup.requestDisallowInterceptTouchEvent(ViewGroup.java:3244)
at android.view.ViewGroup.requestDisallowInterceptTouchEvent(ViewGroup.java:3244)
at android.view.ViewGroup.requestDisallowInterceptTouchEvent(ViewGroup.java:3244)
at android.view.ViewGroup.requestDisallowInterceptTouchEvent(ViewGroup.java:3244)
at android.view.ViewGroup.requestDisallowInterceptTouchEvent(ViewGroup.java:3244)
at android.view.ViewGroup.requestDisallowInterceptTouchEvent(ViewGroup.java:3244)
at android.view.ViewGroup.requestDisallowInterceptTouchEvent(ViewGroup.java:3244)
at android.view.ViewGroup.requestDisallowInterceptTouchEvent(ViewGroup.java:3244)
at android.widget.ScrollView.onInterceptTouchEvent(ScrollView.java:659)
at com.facebook.react.views.scroll.ReactScrollView.onInterceptTouchEvent(ReactScrollView.java:409)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2653)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at com.swmansion.gesturehandler.react.RNGestureHandlerRootView.dispatchTouchEvent(RNGestureHandlerRootView.kt:38)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:500)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1905)
at android.app.Activity.dispatchTouchEvent(Activity.java:4263)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:458)
at android.view.View.dispatchPointerEvent(View.java:15262)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6654)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6454)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5910)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5967)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5933)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6098)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5941)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6155)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5914)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5967)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5933)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5941)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5914)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8996)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8947)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8916)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9119)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:267)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:247)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:9076)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:9210)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
at android.view.Choreographer.doCallbacks(Choreographer.java:899)
at android.view.Choreographer.doFrame(Choreographer.java:824)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Reproducer

https://snack.expo.dev/1XT8GU8hlsNThnmMjYB2Y

Screenshots and Videos

image

cortinico commented 4 months ago

App crashes whenever we scroll inside a Animed.ScrollView that uses React Native Gesture Handler. Not sure if the issue is directly related react-native or react-native-gesture-handler

Please first ask for support on Gesture Handler, and the get back to us if they point out is a core issue 👍 I'll close here as I suspect is a GH issue given the stacktrace.

Feel free to get back to us if folks on GH pin point the issue as it being inside core