Skip to content

Android crash: "[160,"<<NaN>>"] is not usable as a native method argument" #897

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

Open
eirikluka opened this issue Oct 31, 2024 · 5 comments

Comments

@eirikluka
Copy link

After updating to 2.5.5 my app crashes a lot on Android. It seems to be related to unmounting/rerendring/layout and after some digging I found it to be related to #721.

The following line in SegmentControl.js is called in an useEffect when values change, but in some cases width is undefined.

ref.current.measure((_x, _y, width) => updateSegmentWidth(width));
@hengkx
Copy link

hengkx commented Nov 21, 2024

2.5.6 same errors

@sajorahasan
Copy link

I am also experiencing the same error on android with version 2.5.7
Is there any workaround for this issue?

@fahey252
Copy link

fahey252 commented Feb 4, 2025

@sajorahasan the issue only would happen to me when developing locally. As a work around, I would conditionally render the control when not on Android and using a debug build to prevent the crash from happening in other scenarios like release builds or developing locally for iOS.

@see2ever
Copy link

tmp fix: patch-package

ref.current.measure((_x, _y, width) => {
  if (width) {
    updateSegmentWidth(width)
  }
});

@ChenBri
Copy link

ChenBri commented Apr 8, 2025

Same issue at 2.5.7.
Downgrading back to 2.5.4 works.
This should be written in the 2.5.6 notes or something to warn users. this is a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants