react-native: One Plus Animation Error

Description

I am experiencing following issues with only One Plus Telephones. Does anyone have an idea what this might be?

I am having a hard to trying to figure out what causes this.

Can this have something to do with OnePlus Oxygen?

com.facebook.react.animated.FrameBasedAnimationDriver.runAnimationStep
FrameBasedAnimationDriver.java, line 73
java.lang.IllegalStateException: Calculated frame index should never be lower than 0

Stack Trace:

com.facebook.react.animated.FrameBasedAnimationDriver.runAnimationStep FrameBasedAnimationDriver.java:73
com.facebook.react.animated.NativeAnimatedNodesManager.runUpdates NativeAnimatedNodesManager.java:633
com.facebook.react.animated.NativeAnimatedModule$1.doFrameGuarded NativeAnimatedModule.java:263
com.facebook.react.uimanager.GuardedFrameCallback.doFrame GuardedFrameCallback.java:29
com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame ReactChoreographer.java:175
com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame ChoreographerCompat.java:85
android.view.Choreographer$CallbackRecord.run Choreographer.java:1386
android.view.Choreographer$CallbackRecord.run Choreographer.java:1396
android.view.Choreographer.doCallbacks Choreographer.java:1033
android.view.ChoreographerExtImpl.checkScrollOptSceneEnable ChoreographerExtImpl.java:397
android.view.Choreographer.doFrame Choreographer.java:900
android.view.Choreographer$FrameDisplayEventReceiver.run Choreographer.java:1371
android.os.Handler.handleCallback Handler.java:942
android.os.Handler.dispatchMessage Handler.java:99
android.os.Looper.loopOnce Looper.java:240
android.os.Looper.loop Looper.java:351
android.app.ActivityThread.main ActivityThread.java:8321
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:584
com.android.internal.os.ZygoteInit.main ZygoteInit.java:1012

Version

0.70.6

Output of npx react-native info

System: OS: macOS 13.1 CPU: (10) arm64 Apple M1 Pro Memory: 1.25 GB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm Watchman: 2022.12.12.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 17.0.4 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.70.6 => 0.70.6 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

When scrolling through lists this sometimes happens.

Snack, code example, screenshot, or link to a repository

Can’t share since this is for a firm.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 6
  • Comments: 38 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve just saw this in the following devices:

  • OPPO CPH2145
  • OnePlus 9 5G
  • OnePlus 8T
  • OPPO CPH2207
  • OPPO Find X5 Pro

All of them are using Android 13

Hey, I have upgraded to RN 0.72.0, which is the latest version, but still seeing the same crash on oneplus and vivo devices, but as mentioned in #37487, it should be fixed in latest RN versions

the same problems on OPPO with Android 13 devices .

WX20230209-124513@2x

The commit has not been picked for 0.72 yet, but it is listed in the commit to pick. It will be fixed in 0.72.2 Thanks for reporting this issue.

@BennyTian can you please explain more about how we can use JarFilterPlugin

my envs ( If your version is different from mine, you may need to modify it slightly ) :


react-native: 0.61.5 

com.android.tools.build:gradle:3.5.4

1: project -> build.gradle

dependencies {
        ...        
       classpath 'com.github.nekocode:JarFilterPlugin:1.2' //https://github.com/nekocode/JarFilterPlugin
}

2: app -> build.gradle

root node:

apply plugin: "jar-filter"

jarFilter {
    skipFiles = [
      'com/facebook/react/animated/FrameBasedAnimationDriver.class',
      'com/facebook/react/uimanager/ViewManagersPropertyCache.class',
      'com/facebook/react/uimanager/ViewManagersPropertyCache\\$(.*).class',
      'androidx/recyclerview/widget/RecyclerView.class',
      'androidx/recyclerview/widget/RecyclerView\\$(.*).class',
      'okhttp3/Dns.class',
      'okhttp3/Dns\\$(.*).class',
    ]
}

jarFilter is will replace class.

  1. In your android project, create a new class that you want to replace. This class can be found in the RN source code ( or other source ), and then make changes yourself

After you have created classes in the same path in your android project and configured the classes you want to filter in jarFilter, gradle will compile the classes you created instead of the ones in the jar

code

I debugged this a big and submitted a PR working around this vendor bug. #37487

@cortinico, can you take a look?

We’re going to test it in production for a few days and see if it eliminates the issues, so feel free to hold off on the merging until then.

@hsource Did you guys test in production? Can you please help us with your findings?

As you said. Android 13 devices and OPPO devices. +1