react-native icon indicating copy to clipboard operation
react-native copied to clipboard

One Plus Animation Error

Open Hmoulvad opened this issue 1 year ago • 11 comments

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.

Hmoulvad avatar Jan 03 '23 09:01 Hmoulvad

Can't share since this is for a firm.

We can't really investigate without a reproducer.

cortinico avatar Jan 03 '23 19:01 cortinico

:warning: Missing Reproducible Example
:information_source: It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.

github-actions[bot] avatar Jan 03 '23 19:01 github-actions[bot]

Meet the same error on OnePlus pgp110(11)

Sioxas avatar Jan 10 '23 14:01 Sioxas

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

marioabreu avatar Feb 01 '23 11:02 marioabreu

the same problems on OPPO with Android 13 devices .

WX20230209-124513@2x

BennyTian avatar Feb 09 '23 04:02 BennyTian

I have the same problem, all on android 13 devices, is there a solution?

free46000 avatar Feb 10 '23 06:02 free46000

11111 22222

BennyTian avatar Feb 12 '23 08:02 BennyTian

I have the same problem, all on android 13 devices, is there a solution?

BennyTian avatar Feb 12 '23 08:02 BennyTian

I have found that, in fact, when the system doFrame callback, the frameTimeNanos parameter will appear that the time of the next frame is smaller than the time of the last frame for example: lastFrameTimeNanos:10261742601187,frameTimeNanos:10261742589360

free46000 avatar Feb 16 '23 10:02 free46000

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

RRaideRR avatar Mar 02 '23 14:03 RRaideRR

+1 , seeing the issue on Android 13 devices

ankitzepto avatar Mar 09 '23 03:03 ankitzepto

This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

github-actions[bot] avatar Apr 02 '23 06:04 github-actions[bot]

@cortinico still can't provide details on WHEN and WHY this is happening.

We can't just see it from the crashes coming from PlayStore. Do you have any suggestions on how to get a better stack trace for me to provide you?

I can tell you from all my logs from AppCenter and PlayStore that's only happening on OnePlus telephones using Android 13.

Hmoulvad avatar Apr 04 '23 13:04 Hmoulvad

As mentioned, without a clear repro, it's impossible for us to do anything here.

We can't just see it from the crashes coming from PlayStore. Do you have any suggestions on how to get a better stack trace for me to provide you?

I know this can be hard, but I suggest to get a OnePlus phone on Android 13, and try to reproduce locally. If you manage to isolate the crash we can look into fixing it somehow

cortinico avatar Apr 05 '23 10:04 cortinico

@cortinico aight cool! I will do all in my power in order to reproduce this error ;-)

Hmoulvad avatar Apr 12 '23 07:04 Hmoulvad

same problem

bashen1 avatar Apr 18 '23 07:04 bashen1

I have the same issue. If FlatList is scrolling when refreshing the next page data is loaded, this issue will occur.

whytimber avatar Apr 21 '23 08:04 whytimber

Same issue, It's very difficult to reproduce. @Hmoulvad were you able to reproduce ?? @whytimber Can you share the sample code or any steps to reproduce if you have ?

vivek0tiwari avatar May 12 '23 06:05 vivek0tiwari

@vivek0tiwari havn't been able to reproduce it no :(

Hmoulvad avatar May 12 '23 11:05 Hmoulvad

Yes seeing this issue in android 13 (+1)

vaibsshukla avatar May 16 '23 05:05 vaibsshukla

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 avatar May 19 '23 00:05 hsource

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

malikzype avatar Jun 06 '23 11:06 malikzype

Closing as this got addressed by #37487

cortinico avatar Jun 06 '23 12:06 cortinico

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

sarthakgdeveloper avatar Jun 26 '23 04:06 sarthakgdeveloper

Any updates facing the same issue in RN 0.72.0

shikhar119911 avatar Jul 06 '23 19:07 shikhar119911

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.

cipolleschi avatar Jul 07 '23 08:07 cipolleschi

same issue : Oppo and OnePlus phones (Android 13)

com.facebook.react.animated.FrameBasedAnimationDriver.runAnimationStep java.lang.IllegalStateException - Calculated frame index should never be lower than 0

manojalwisnz avatar Jul 20 '23 21:07 manojalwisnz

This patch from @hsource https://github.com/facebook/react-native/commit/c05d822f7daa92e8af2ec2cd97a9897425624cc2 might just work. We are seeings thousands of events from this single crash.

I would really appreciate it if someone can help me with the steps to include this patch in my current react-native version of 0.69.8. I understand I need to build this source for my app to pick up the changes I do locally in the file. But I'm unsure as to what the exact steps would be. All I need is to just simply include this patch : https://github.com/facebook/react-native/commit/c05d822f7daa92e8af2ec2cd97a9897425624cc2 in my current react native app.

Thanks in advance!

aditya-keri-betterhalf avatar Jul 26 '23 07:07 aditya-keri-betterhalf

Was it fixed in version 0.71.13?

Thanks in advance!

sebas21 avatar Aug 28 '23 16:08 sebas21

modify:

com.facebook.react.animated.FrameBasedAnimationDriver.java

line: 72

//throw new IllegalStateException("Calculated frame index should never be lower than 0");
return ;

use https://github.com/nekocode/JarFilterPlugin to replace class in jar.

BennyTian avatar Aug 29 '23 07:08 BennyTian