-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
com.swmansion.reanimated.layoutReanimation.AnimationsManager.prepareDataForAnimationWorklet #2959
Comments
Hi @dodiwknd! I've run into this issue, which seems to cover the same NPE. Can you try updating reanimated to 2.4.1? |
Unfortunately I can't provide samples, this application has been built very extensively, because I don't know for sure when this will happen. I think this is happening because the animated Layout has not been rendered and the user has navigated to another page. hope this can help you |
ran across the same crash recently. we started seeing it once we added an Animated.View with a layout animation. so the suggestion from @dodiwknd may be correct. excerpt from the component: export default function UpdateHighlightsBanner() {
const dispatch = useDispatch();
const { dismissedBanner, updatedOn } = useSelector((store: RootState) => store.settings.version);
const { releaseNote } = useAppUpdate();
const releaseNotes = releaseNote.replace(/; /g, ";").split(";");
const daysSinceUpdate = differenceInDays(today, parseISO(updatedOn));
const handleOnDismiss = () => {
dispatch(settingsActions.dismissUpdatesBanner());
};
const visible = !dismissedBanner && daysSinceUpdate <= 3 && releaseNotes.length > 1;
if (false === visible) return null;
return (
<Animated.View style={styles.container} exiting={FadeOut.duration(200)} layout={Layout.delay(250)}>
<Image source={require("./update-highlights-confetti.webp")} style={styles.confetti} />
<View style={styles.header}>
<Text>Some text</Text>
<Pressable onPress={handleOnDismiss}>
<Icon name="close" />
</Pressable>
</View>
<DisplayTextList icon="check" iconColor={Theme.palette.success} list={releaseNotes.slice(0, 3)} />
</Animated.View>
);
} |
## Description ReactApplicationContext.getCurentContext sometimes return null. This causes a crash (NullPointerException) in reanimated due to not checking if context exists. As per react native's examples, we can only measure device metrics when current activity is not null (https://github.com/facebook/react-native/blob/8bd3edec88148d0ab1f225d2119435681fbbba33/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.java#L56) Fixes #2959. ## Changes Check if current activity is not null before measuring the device.
…re-mansion#3162) ## Description ReactApplicationContext.getCurentContext sometimes return null. This causes a crash (NullPointerException) in reanimated due to not checking if context exists. As per react native's examples, we can only measure device metrics when current activity is not null (https://github.com/facebook/react-native/blob/8bd3edec88148d0ab1f225d2119435681fbbba33/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.java#L56) Fixes software-mansion#2959. ## Changes Check if current activity is not null before measuring the device.
Description
Android app crash on production mode
Expected behavior
on release build app not crashing
Actual behavior & steps to reproduce
on release versions the app doesn't crash, but sends an error like:
Snack or minimal code example
on the screen capture
Package versions
Affected platforms
The text was updated successfully, but these errors were encountered: