react-native-gifted-charts
react-native-gifted-charts copied to clipboard
java.lang.Double cannot be cast to com.facebook.react.bridge.ReadableMap
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:
- Copy Example App
- See error
Screenshots
- 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 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",
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 @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?
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",
@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
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.
so is this problem solved?
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",
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
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"
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, removepackage-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.
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
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...
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?
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
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.
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)
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)?
Has anyone found a solution to this with Expo Dev Client?
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.