software-mansion / react-native-reanimated

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

[Android] Crash on app launch, after upgrade to 2.3.0 #2727

Closed alimek closed 2 years ago

alimek commented 2 years ago

Description

My app once bootsplash is destroyed I am shoiwing some animation as 1st thing. App is crashing just after opening only in release build on Android. iOS with version 2.3.0 is working fine.

Stack strace:

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.swmansion.reanimated.layoutReanimation.f.j()' on a null object reference
        at com.swmansion.reanimated.layoutReanimation.g.r(ReanimatedNativeHierarchyManager.java:1)
        at com.facebook.react.uimanager.x0$m.c(UIViewOperationQueue.java:1)
        at com.facebook.react.uimanager.x0$a.run(UIViewOperationQueue.java:19)
        at com.facebook.react.uimanager.x0.U(UIViewOperationQueue.java:10)
        at com.facebook.react.uimanager.x0.s(UIViewOperationQueue.java:1)
        at com.facebook.react.uimanager.x0$j.c(UIViewOperationQueue.java:6)
        at com.facebook.react.uimanager.f.a(GuardedFrameCallback.java:1)
        at com.facebook.react.modules.core.g$d.a(ReactChoreographer.java:7)
        at com.facebook.react.modules.core.a$a$a.doFrame(ChoreographerCompat.java:1)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1056)
        at android.view.Choreographer.doCallbacks(Choreographer.java:880)
        at android.view.Choreographer.doFrame(Choreographer.java:809)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:236)
        at android.app.ActivityThread.main(ActivityThread.java:7879)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)

Downgrading renimated to 2.2.4 works fine.

Expected behavior

App should launch without crash.

Package versions

Affected platforms

github-actions[bot] commented 2 years ago

Issue validator

The issue is invalid!

ahmetbicer commented 2 years ago

I was getting the same issue. I solved it by adding reanimated to proguard rules.

-keep class com.swmansion.reanimated.** { *; }

Link to the PR: https://github.com/software-mansion/react-native-reanimated/pull/2725

kakajann commented 2 years ago

@ahmetbicer that saved my day!

alexco2 commented 2 years ago

@alimek did you have a look at https://github.com/software-mansion/react-native-reanimated/issues/2246?

alimek commented 2 years ago

I was getting the same issue. I solved it by adding reanimated to proguard rules.

-keep class com.swmansion.reanimated.** { *; }

Link to the PR: #2725

this fixed issue for me, I can close issue i think, as there is PR already.

priyankaEdufund commented 2 years ago

I was getting the same issue. I solved it by adding reanimated to proguard rules.

-keep class com.swmansion.reanimated.** { *; }

Link to the PR: #2725

Thanks buddy, saved my time :)

mercpls commented 2 years ago

I was getting the same issue. I solved it by adding reanimated to proguard rules. -keep class com.swmansion.reanimated.** { *; } Link to the PR: #2725

Thanks buddy, saved my time :)

Any response for someone not using proguard, but using crashlytics?