Skip to content
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

[iOS] App crash when using navigation #5968

Closed
inoxxe opened this issue May 2, 2024 · 7 comments · Fixed by #5975
Closed

[iOS] App crash when using navigation #5968

inoxxe opened this issue May 2, 2024 · 7 comments · Fixed by #5975
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@inoxxe
Copy link

inoxxe commented May 2, 2024

Description

App crashes when trigger navigation.goBack() on react navigation when using react navigation v6 and adding react native reanimated version 3.10.0 on my react native project.

Here is my package.json

  
  {
  "name": "testAnimated",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "@react-navigation/bottom-tabs": "^6.5.20",
    "@react-navigation/native": "^6.1.17",
    "@react-navigation/native-stack": "^6.9.26",
    "react": "18.2.0",
    "react-native": "0.74.0",
    "react-native-reanimated": "^3.10.0",
    "react-native-safe-area-context": "^4.10.1",
    "react-native-screens": "^3.31.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/babel-preset": "0.74.81",
    "@react-native/eslint-config": "0.74.81",
    "@react-native/metro-config": "0.74.81",
    "@react-native/typescript-config": "0.74.81",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.6.3",
    "eslint": "^8.19.0",
    "jest": "^29.6.3",
    "prettier": "2.8.8",
    "react-test-renderer": "18.2.0",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  }
}

Steps to reproduce

  1. create new React Native Project (0.74)
  2. Add react-navigation library
  3. Add react-native-reanimated (3.10.0)
  4. trigger navigation.goBack() on stack navigator

Snack or a link to a repository

https://github.com/inoxxe/test-reanimated

Reanimated version

3.10.0

React Native version

0.74

Platforms

iOS

JavaScript runtime

None

Workflow

None

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Repro provided A reproduction with a snippet of code, snack or repo is provided Platform: iOS This issue is specific to iOS labels May 2, 2024
@GabeConsalter
Copy link

GabeConsalter commented May 2, 2024

I think that I'm having a issue related with this.
I'm having a crash with this error below when tap on BottomTabNavigation tab from react-navigation:
image

  • React Native 0.74.0
  • Reanimated 3.10.0
  • React Navigation 6.5.20

@inoxxe
Copy link
Author

inoxxe commented May 2, 2024

I think that I'm having a issue related with this. I'm having a crash with this error below when tap on BottomTabNavigation tab from react-navigation: image

  • React Native 0.74.0
  • Reanimated 3.10.0
  • React Navigation 6.5.20

Yup my app crashed when navigating back from another tab in bottom tab navigation

@foneazmi
Copy link

foneazmi commented May 3, 2024

downgrade Reanimated to 3.8.1 fix the issue

@angusryer
Copy link

Downgrading to 3.8.1 avoids the issue for me as well. I have the same Xcode log output as @GabeConsalter.

@erez-unitronics
Copy link

React native 0.74.1 solved this problem for me.
(with v3.10.0)

@tomekzaw
Copy link
Member

tomekzaw commented May 5, 2024

Thanks @inoxxe for reporting this issue and everyone else for your comments.

Looks like this problem has already been reported so I'm gonna mark this issue as duplicate and close it in favor of:

@tomekzaw tomekzaw closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2024
github-merge-queue bot pushed a commit that referenced this issue May 5, 2024
…TransitionConfigForTag:]` (#5975)

## Summary

Fixes
#5947.
Fixes
#5968.

When `react-native-reanimated` is installed but not used directly,
switching between bottom tabs from `@react-navigation/bottom-tabs` will
result in a `EXC_BAD_ACCESS` crash on iOS.

This PR adds missing mock for `_clearSharedTransitionConfigForTag` as
suggested by @bartlomiejbloniarz.

## Test plan

Try repro from
#5947 (comment)
@inoxxe
Copy link
Author

inoxxe commented May 5, 2024

Thank you for the fix @tomekzaw
My temp solution is to add

use_frameworks! :linkage => :static

In your podfile for anyone who encounter this issue. Since my project that use RN 0.74.0 and react native firebase doesn't suffer the issue.

2wons added a commit to code-geass-tech/carident that referenced this issue May 8, 2024
added `prop-types` package due to expo/vector-icons/vendor/react-native-vector--icons dependency

import`reanimated` in `app/_layout.tsx` to workaround navigation crash ([Expo related issue](software-mansion/react-native-reanimated#5968))

npm install with `--legacy-peer-deps` flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
6 participants