software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.59k stars 1.26k forks source link

react-native-reanimated run time build crash #6127

Closed justankit closed 1 week ago

justankit commented 2 weeks ago

Description

Hi,

Getting run time build crash with the following error

FATAL EXCEPTION: main Process: com.example, PID: 8973 java.lang.VerifyError: Verifier rejected class com.swmansion.reanimated.NodesManager: void com.swmansion.reanimated.NodesManager.startUpdatingOnAnimationFrame() failed to verify: void com.swmansion.reanimated.NodesManager.startUpdatingOnAnimationFrame(): [0xF] register v2 has type Reference: com.facebook.react.uimanager.GuardedFrameCallback but expected Reference: com.facebook.react.modules.core.ChoreographerCompat$FrameCallback void com.swmansion.reanimated.NodesManager.stopUpdatingOnAnimationFrame() failed to verify: void com.swmansion.reanimated.NodesManager.stopUpdatingOnAnimationFrame(): [0xF] register v2 has type Reference: com.facebook.react.uimanager.GuardedFrameCallback but expected Reference: com.facebook.react.modules.core.ChoreographerCompat$FrameCallback (declaration of 'com.swmansion.reanimated.NodesManager' appears in /data/app/~~_ymoq04sBizC0p5DkVQeQA==/com.example-mOXjHn4Iv7HNDFvIIK66TQ==/base.apk!classes4.dex) at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:95) at com.swmansion.reanimated.ReanimatedModule.access$000(ReanimatedModule.java:24) at com.swmansion.reanimated.ReanimatedModule$1.execute(ReanimatedModule.java:80) at com.facebook.react.uimanager.UIViewOperationQueue$UIBlockOperation.execute(UIViewOperationQueue.java:557) at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:910) at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1023) at com.facebook.react.uimanager.UIViewOperationQueue.-$$Nest$mflushPendingBatches(Unknown Source:0) at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1083) at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29) at com.facebook.react.modules.core.ReactChoreographer$1.doFrame(ReactChoreographer.java:89) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1229) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239) at android.view.Choreographer.doCallbacks(Choreographer.java:899) at android.view.Choreographer.doFrame(Choreographer.java:827) 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)

React Native version - 0.74.1 react-native-reanimated version - 1.13.4

Steps to reproduce

  1. Converted react native app to library i.e .aar file
  2. Integrated the same in Android Java App.
  3. Added all the dependencies in app/build.gradle of Android App 4.App is getting launched but when I try to start react native app activity it crashes with the above error.

Snack or a link to a repository

...

Reanimated version

1.13.4

React Native version

0.74.1

Platforms

Android

JavaScript runtime

None

Workflow

React Native

Architecture

Paper (Old Architecture)

Build type

None

Device

Android emulator

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 2 weeks ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

C2418M31 commented 2 weeks ago

This also happens to me when I tried to convert RN project to .aar

Could not determine the dependencies of task ':react-native-reanimated:compileDebugJavaWithJavac'.

Could not resolve all task dependencies for configuration ':react-native-reanimated:debugCompileClasspath'. Could not find com.facebook.react:react-android:. Required by: project :react-native-reanimated

dependencies {
    // The version of react-native is set by the React Native Gradle Plugin
    implementation("com.facebook.react:react-android:0.74.1")

    if (hermesEnabled.toBoolean()) {
        implementation("com.facebook.react:hermes-android:0.74.1")
    } else {
        implementation jscFlavor
    }
}

I hope anyone can help about this.

szydlovsky commented 1 week ago

Hey @justankit Reanimated 1.x isn't supported anymore (even Reanimated 2.x doesn't support react native >= 0.72), so there is nothing we can do about it with version 0.74.1. I advise you to follow steps on migration from 1.x to 2.x and then from 2.x to 3.x.