Skip to content

ProgressBar crashes app in new arch on android #4544

@pnthach95

Description

@pnthach95

Current behaviour

In new arch android, ProgressBar crashes app when long length float value is used in progress. It works with 1/2, 1/4 but not 1/3.

Error log: Warning: Error: Exception in HostFunction: Loss of precision during arithmetic conversion: (long) 33.33333333333333

It works on iOS but you have this error in xcode log, Error while converting prop 'accessibilityValue': Loss of precision during arithmetic conversion: (long long) 33.33333333333333

Expected behaviour

ProgressBar should work with long length float value in new arch on android

How to reproduce?

  • Create new project and enable new arch
  • Run this code and press buttons
const [progress, setProgress] = useState(1);

<ProgressBar progress={progress} />
<Button
  onPress={() => {
     setProgress(1 / 2);
  }}>
  1/2 work
</Button>
<Button
  onPress={() => {
     setProgress(1 / 3);
  }}>
  1/3 not work
</Button>

Preview

Screen_Recording_20241107_141459.mp4

What have you tried so far?

Your Environment

software version
ios 18.1
android 14
react-native 0.76.1
react-native-paper 5.12.5
node 20.12.1
yarn 3.6.4
expo sdk x.x.x

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions