react-native-gifted-charts icon indicating copy to clipboard operation
react-native-gifted-charts copied to clipboard

java.lang.Double cannot be cast to com.facebook.react.bridge.ReadableMap

Open Vynex opened this issue 2 years ago • 1 comments

Describe the bug When I try to use any of the Charts available in the package I get the following issue. Tested on multiple devices, also with a newly init App. However, weirdly when I copied the code for the charts from source it works without any errors.

To Reproduce Steps to reproduce the behavior:

  1. Copy Example App
  2. See error

Screenshots 69bb3f27-a1b3-447f-8a9f-4c0a21be7d6c

  • Device tested on: [OnePlus Nord 2, ROG Phone 5, Samsung Galaxy M52]
  • OS: [Android 12]
  • Version of the library being used [1.2.41]

Vynex avatar Aug 25 '22 10:08 Vynex

@Vynex I got this issue. After fixing the following packages with the specific versions and reinstalling all the packages worked for me. "react-native-linear-gradient": "2.5.6", "react-native-svg": "12.1.0",

zameerm99x avatar Aug 29 '22 09:08 zameerm99x

I can confirm that @zameerm99x fix works with 2.6.2:

"react-native-linear-gradient": "2.6.2",
"react-native-svg": "12.1.0",

FranDepascuali avatar Nov 02 '22 16:11 FranDepascuali

@FranDepascuali @zameerm99x I had the same error and changed the versions as you guys said but it doesnt work... In my case I tried in ios and android expo go application. In ios works perfectly but in android I still have the error " java.lang.Double cannot be cast to com.facebook.react.bridge.ReadableMap". also tried to change it to the newest version which is "react-native-svg": "^13.6.0" but did not work either... Anybody with other solutions?

lheshiki avatar Dec 01 '22 13:12 lheshiki

just to mentioned that the error content changed to "Invariant Violation: requireNativeComponent: "RNSVGSvgViewAndroid" was not found in the UIManager.". I can tell it is still related with the svg version of react-native-svg I guess... Hoping somebody run into the same error in the past... below the versions of my files

"react-native-linear-gradient": "2.6.2", "react-native-svg": "^12.1.0",

lheshiki avatar Dec 01 '22 14:12 lheshiki

@FranDepascuali @zameerm99x I had the same error and changed the versions as you guys said but it doesnt work... In my case I tried in ios and android expo go application. In ios works perfectly but in android I still have the error " java.lang.Double cannot be cast to com.facebook.react.bridge.ReadableMap". also tried to change it to the newest version which is "react-native-svg": "^13.6.0" but did not work either... Anybody with other solutions?

Same for me

Leonit654 avatar Jan 05 '23 21:01 Leonit654

I had the same issue due to an empty quote "" on the fill attribute like this: <RamadanDua width={70} height={40} fill=" " />. After I had removed it, it worked fine.

Lieutenant-Vernyc avatar Jan 10 '23 04:01 Lieutenant-Vernyc

so is this problem solved?

pahirdinhamut avatar Jan 31 '23 16:01 pahirdinhamut

I have the same problem

"react-native-svg": "13.4.0",
"styled-components": "^5.3.6",
"react-native-linear-gradient": "^2.6.2",
"react-native-fontawesome-pro": "^2.1.0",

MatheusHash avatar Jan 31 '23 18:01 MatheusHash

Update:I can confirm these versions work for me:

"react-native-linear-gradient": "2.6.2",
"react-native-svg": "12.4.4",

Avoid updating react-native-svg to 13.x.x, otherwise it will fail

FranDepascuali avatar Feb 02 '23 01:02 FranDepascuali

I had the exact same err on android. Downgrading to Expo v45 worked for me. I was on Expo v47.

I used expo-cli upgrade 45, it helps u change the Expo version, change dependencies version to a compatible one, remove package-lock.json & node_modules and install everything back again, works like magic.

"react-native-svg": "13.4.0" was also automatically downgraded to "react-native-svg": "12.3.0"

yewyewXD avatar Feb 20 '23 06:02 yewyewXD

I had the exact same err on android. Downgrading to Expo v45 worked for me. I was on Expo v47.

I used expo-cli upgrade 45, it helps u change the Expo version, change dependencies version to a compatible one, remove package-lock.json & node_modules and install everything back again, works like magic.

"react-native-svg": "13.4.0" was also automatically downgraded to "react-native-svg": "12.3.0"

How do you install everything again? I'm afraid of removing the package-lock json and node modules. I've heard bad things about doing that.

EDIT: okay so this works, automatically.

eatanga-git avatar Mar 31 '23 21:03 eatanga-git

I had the same issue due to an empty quote "" on the fill attribute like this: . After I had removed it, it worked fine.

Same for me, had an svg with the following logic <Pause fill={timerRunning && "#0B6DFF"}/>

Changed it to <Pause fill={timerRunning? "#0B6DFF" : "#000000"}/> and works perfectly

AdkoToIdeRozbit avatar Jun 16 '23 21:06 AdkoToIdeRozbit

Can you go more in depth with this? What file is this?

Is gifted charts working fine for you now? Or anyone else?

I think it would be helpful if someone just posted the whole package json at this point...

eatanga-git avatar Jun 17 '23 03:06 eatanga-git

I had the same issue due to an empty quote "" on the fill attribute like this: . After I had removed it, it worked fine.

Same for me, had an svg with the following logic <Pause fill={timerRunning && "#0B6DFF"}/>

Changed it to <Pause fill={timerRunning? "#0B6DFF" : "#000000"}/> and works perfectly

What file? How did you know this was the issue?

eatanga-git avatar Jun 20 '23 22:06 eatanga-git

in my case i am using react-native-iconly and the same issue occurs, no clue on what to do as i'm only a fresher

radiancegeorge avatar Jun 25 '23 14:06 radiancegeorge

Hey guys👋 The dependencies have been upgraded in version 1.3.0🎉

Please use the latest version and feel free to reopen if the issue still persists.

Abhinandan-Kushwaha avatar Jul 02 '23 21:07 Abhinandan-Kushwaha

Hi @Abhinandan-Kushwaha

I have tried with these versions "react-native-svg": "^13.6.0", (also 13.4.0) "react-native-linear-gradient": "^2.6.2", "react-native-gifted-charts": "^1.3.0",

Now fails with (requireNativeComponent: "RNSVGSvgViewAndroid" was not found in the UIManager)

Count-Monte avatar Jul 10 '23 09:07 Count-Monte

Hi @Abhinandan-Kushwaha

I have tried with these versions "react-native-svg": "^13.6.0", (also 13.4.0) "react-native-linear-gradient": "^2.6.2", "react-native-gifted-charts": "^1.3.0",

Now fails with (requireNativeComponent: "RNSVGSvgViewAndroid" was not found in the UIManager)

I have this error too. Expo Dev Client version 47. What is the correct setup?

Also, which versions of Expo even support svg 13.9?

@Abhinandan-Kushwaha , could you post which dependencies are needed, and if they work with Expo Dev client (or any other Expo builds)?

eatanga-git avatar Jul 13 '23 21:07 eatanga-git

Has anyone found a solution to this with Expo Dev Client?

eatanga-git avatar Jul 25 '23 02:07 eatanga-git

Are you guys still facing this issue? A new version of react-native-gifted-charts is recently released which has react-native-svg listed as a peer dependency instead of a direct dependency. Please try the latest version of the library where this issue is hopefully resolved.

Abhinandan-Kushwaha avatar Sep 07 '23 10:09 Abhinandan-Kushwaha