software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
5.85k stars 954 forks source link

java.lang.Double cannot be cast to java.lang.String on Android Device #2506

Closed usegravity closed 7 months ago

usegravity commented 11 months ago

Description

java.lang.Double cannot be cast to java.lang.String error when using ScrollView with RefreshControl on Samsung mobile with Android 13.

Works fine on iOS and iOS Simulator, ScrollView works without the RefreshControl without issue.

Have tried using ScollView from both react-native and react-native-gesture-handler.

issue2

issue1

Steps to reproduce

  1. Import ScrollView from react-native-gesture-handler
  2. Import RefreshControl from react-native
  3. Pass RefreshControl to refreshControl prop.

Snack or a link to a repository

https://snack.expo.dev/Zi4LSp08D

Gesture Handler version

2.11.0

React Native version

0.71.8

Platforms

Android

JavaScript runtime

None

Workflow

Expo managed workflow

Architecture

None

Build type

None

Device

Real device

Device model

No response

Acknowledgements

Yes

j-piasecki commented 10 months ago

I don't have a Samsung device on me right now, here are some tips though:

Your snack with those changes works for me on Android 13 AOSP. If it doesn't help you, could you provide a reproduction closer to your actual implementation? I will recheck it once I have access to some Samsung devices.

yunussheikh commented 10 months ago

Hello @j-piasecki,

Thank you for your reply.

Your proposed solution is also giving the same error message on my Samsung device.

m-bert commented 9 months ago

Hi @usegravity and @yunussheikh! I've just tested this on my Samsung device with Android 13 and everything seems to work fine. In order to do that, I had to prepare my own repro. Here is the code that I used:

import React from 'react';
import { Text, View } from 'react-native';
import { ScrollView } from '../../src/components/GestureComponents';
import { RefreshControl } from 'react-native';

export default function Test(props) {
  const [refreshing, setRefreshing] = React.useState(false);

  const onRefresh = React.useCallback(() => {
    setRefreshing(true);
    setTimeout(() => {
      setRefreshing(false);
    }, 100);
  }, []);

  return (
    <ScrollView
      refreshControl={
        <RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
      }>
      <Text>Testing</Text>
    </ScrollView>
  );
}

If you still experience this issue, please prepare repro so we can have a look at it.

kbqdev commented 1 month ago

+1 same with reac-native : 0.71.6