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

RNSHeaderHeightChangeEvent: unrecognized selector sent to instance #1932

Closed
josemurillodev opened this issue Oct 19, 2023 · 6 comments · Fixed by #1933
Closed

RNSHeaderHeightChangeEvent: unrecognized selector sent to instance #1932

josemurillodev opened this issue Oct 19, 2023 · 6 comments · Fixed by #1933
Labels
Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided

Comments

@josemurillodev
Copy link

josemurillodev commented Oct 19, 2023

Description

With new architecture using stack navigator causes a crash, even the hello-react-navigation example is not working for me, if I let the Stack.Navigator component without any screens or a Stack.Screen outside a navigator I get errors but the app doesn't crash

[RNSHeaderHeightChangeEvent canCoalesce]: unrecognized selector sent to instance

image

System:
OS: macOS 14.0
CPU: (10) arm64 Apple M2 Pro
Memory: 83.50 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.17.1
path: ~/.nvm/versions/node/v18.17.1/bin/node
Yarn:
version: 1.22.19
path: ~/.nvm/versions/node/v18.17.1/bin/yarn
npm:
version: 9.6.7
path: ~/.nvm/versions/node/v18.17.1/bin/npm
Watchman:
version: 2023.10.09.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.12.1
path: /Users/username/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- iOS 17.0
Android SDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.10121639
Xcode:
version: 15.0/15A240d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 20.0.2
path: /usr/bin/javac
Ruby:
version: 2.7.5
path: /Users/username/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.1
wanted: 0.72.1
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: true

Steps to reproduce

  1. NO_FLIPPER=1 USE_FRAMEWORKS=static RCT_NEW_ARCH_ENABLED=1 pod install
  2. react-native start --reset-cache
  3. Build and run the app

Snack or a link to a repository

https://snack.expo.dev/@joseluismurillorios/vigorous-blue-yogurt

Screens version

3.26.0

React Native version

0.72.1

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Repro provided A reproduction with a snack or repo is provided Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Platform: tvOS Issue related with tvOS compatibility and removed Platform: tvOS Issue related with tvOS compatibility labels Oct 19, 2023
@isinuyk
Copy link

isinuyk commented Oct 20, 2023

+1
IOS only, new arch enabled
react-native 0.72.6
react-native-screens 3.26.0

On Android with the new arch, it works without crashing.

Downgrading to 3.25.0 fixes the problem for me.

@tboba
Copy link
Member

tboba commented Oct 20, 2023

Hey @joseluismurillorios, thanks for reporting this issue!
I think I've just found where's the problem - RNSHeaderHeightChangeEvent should have canCoalesce method. Strangely, I haven't met this error yet 🤔

Will submit a PR with the change shortly 👍

@tboba
Copy link
Member

tboba commented Oct 20, 2023

@joseluismurillorios @isinuyk could you check if changes made in branch @tboba/fix-cancoalesce-method fixes your problem?

You can get the version with those changes by changing the dependency react-native-screens in package.json to:
"react-native-screens": "software-mansion/react-native-screens#@tboba/fix-cancoalesce-method"

@josemurillodev
Copy link
Author

@tboba Yes, those changes fixed the problem!

@tboba
Copy link
Member

tboba commented Oct 20, 2023

@joseluismurillorios thanks for the update! I think we will release the patch that includes that fix. Stay tuned 🙏

tboba added a commit that referenced this issue Oct 23, 2023
## Description

It looks like when I was implementing class that is representing the
`onHeaderHeightChange` I made a mistake and I forgot / accidentally
removed `canCoalesce` method which led to displaying
`RNSHeaderHeightChangeEvent: unrecognized selector sent to instance` for
a couple of users.

This issue resolves that error by adding `canCoalesce` method to the
event.
Fixes #1932.

## Changes

- Added `canCoalesce` method to `RNSHeaderHeightChangeEvent` file

## Test code and steps to reproduce

You can test the changes by checking `Test1802.tsx` component in
FabricTestExample.

## Checklist

- [ ] Ensured that CI passes
@tboba
Copy link
Member

tboba commented Oct 24, 2023

Hey @joseluismurillorios @isinuyk @lukmccall! Just wanna announce that we're released react-native-screens 3.27.0 which includes that fix! 🎉
If you're still facing any problems in the newest version, don't hesitate to open a new issue 🙏

Cheers!

ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this issue Oct 9, 2024
…tware-mansion#1933)

## Description

It looks like when I was implementing class that is representing the
`onHeaderHeightChange` I made a mistake and I forgot / accidentally
removed `canCoalesce` method which led to displaying
`RNSHeaderHeightChangeEvent: unrecognized selector sent to instance` for
a couple of users.

This issue resolves that error by adding `canCoalesce` method to the
event.
Fixes software-mansion#1932.

## Changes

- Added `canCoalesce` method to `RNSHeaderHeightChangeEvent` file

## Test code and steps to reproduce

You can test the changes by checking `Test1802.tsx` component in
FabricTestExample.

## Checklist

- [ ] Ensured that CI passes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants