Invariant Violation: requireNativeComponent: "RNSVGSvgViewAndroid" was not found in the UIManager in Android - javascript

I am using expo sdk 47 Managed Workflow and try to build project with UI Kitten Framework
https://akveo.github.io/react-native-ui-kitten/
On iOS everything works fine.
On Android I have an issue Invariant Violation: requireNativeComponent: "RNSVGSvgViewAndroid" was not found in the UIManager.
Trying t find the solution and no luck.
Reinstalled everything several times.
I have
"#ui-kitten/components": "^5.1.2",
"expo": "~47.0.8",
"react": "18.1.0",
"react-native-svg": "^13.6.0",
The issue is with latest versions of expo SDK. Any ideas how to fix?
Does anybody has the same?
I found only this fresh question but it is related with another library and solution does not work for me.
Invariant Violation: requireNativeComponent: "RNSVGSvgViewAndroid" was not found in the UIManager
also tried with "react-native-svg": "^13.4.0" which is recommended by expo sdk47 but has another error (https://github.com/software-mansion/react-native-svg/issues/1899) which is recommended to fix by installing 13.5.0 but then I getting initial error.
After spending several days to find solution I have no other ideas rather than to ask here.

I got the error when I used "react-native-svg": "13.6.0", downgrading to "react-native-svg": "13.4.0" solved the issue.

You cannot use "react-native-svg": "13.6.0" with expo sdk 47 Managed Workflow because the native code is compiled there already, and it is compiled with "react-native-svg": "13.4.0" version of native code. Between those versions, the naming of native component changed, so when using "react-native-svg": "13.6.0", you update only the JS code, which tries to get new name of component from the native side, but the native code still has the previous name compiled. It resolves in such an error. Unfortunately there is no solution to this problem in managed workflow, the easiest solution would be to use EAS (https://expo.dev/eas) to build custom version of Expo Go app with "react-native-svg": "13.6.0" compiled in it.

when using expo run:
expo i react-native-svg

Related

React -Vite require not defined in build but works fine in dev

I have built a small practice project using React and Vite, and everything worked well in the development environment.
However, when I built it and attempted to preview it, I encountered the following error:
"Uncaught ReferenceError: require is not defined."
The issue is that I do not use the 'require' function in my code, I only use imports. Is this related to the npm packages that I have installed?
If so, how can I find the correct package to fix it or are there any other solutions?
I attempted to install a plugin called 'vite-require' but it did not work (maybe I did something incorrectly).
I am writing here in hopes of finding a solution to this issue.
Thank you for any answers in advance.

Error : "ARTShape" was not found in the UIManager - React native

I just upgraded my expo SDK to the last version so I faced some issue about some screens where the react-native-pie-chart & react-native-pie doesn't work I google it but I didnt found the solution for those who suggest to link the react-native-community/art that's not working in Expo.May someone suide me to solve it please
Error:
Invariant Violation: requireNativeComponent: "ARTShape" was not found
in the UIManager.
This error is located at:
in ARTShape (created by Shape)
in Shape (at Pie.tsx:42)
I notice that those libraries are not working in this version so I tried to find a solution and I found it won't work on Android because it needs to be link as you are using the expo so it's not possible.
Solution proposed : You can eject the project than can run it.
And that's not working for me because I'm using some features of expo so I tried to install
expo install react-native-svg-charts
and worked 100% for me. I hope that's help

TypeError: Cannot read properties of undefined (reading 'MethodInfo') in react js app using grpc-web

I am using grpc-web to communicate with a java backend over gRPC. I am using ReactJS on the frontend which uses grpc-web to interpret the protobuffers.
I am getting this strange error. My protos are correct ( I checked using a reflection tool called "bloom" so the backend is just fine) This somehow seems like an error internal to the grpc libraries I am using in ReactJS.
I get the following error:
TypeError: Cannot read properties of undefined (reading 'MethodInfo')
The above error points to my proto file: dashboard_services_grpc_web_pb.js
In this file, it point to this line
const methodInfo_DashboardService_userLogin = new grpc.web.AbstractClientBase.MethodInfo( ...... );
I have a hard time solving this because according to my understanding, grpc.web.AbstractClientBase is something native to grpc-web.
I have also reinstalled my node_modules in hopes that this is a version issue but no avail.
I had the same issue because I was using an old release of the executable protoc-gen-grpc-web with respect to the current version of grpc-web. Using version 1.3.0 for both solved the issue for me.
You can download the latest release of protoc-gen-grpc-web here.
In my case it was happening after cache clear, because we had:
"grpc-web": "^1.2.1",
and it was installed version 1.3.0 I changed it to:
"grpc-web": "1.2.1",
and yarn again to fix this issue!

Updating #material-ui/core to version 4.2.0 causes react hook errors

I am creating an electron application using react and material-ui. I just updated material-ui to version 4.2.0. The following lines were added to my dependencies in package.json.
"#material-ui/core": "^4.2.0",
"#material-ui/icons": "^4.2.1",
This was the only change I made and now my app is not working, and crashing with the following error.
Uncaught Invariant Violation: Invalid hook call.
Strangely enough, I am not even using hooks in my react application yet. The error message persists until I remove all usage of material-ui in my application. I have also tried rebuilding my application and regenerating yarn.lock and node_modules but that did not work. I am puzzled with how simply updating material-ui to a newer stable release could cause this error. Has anyone had this problem and/or have a solution? Thank you.
UPDATE:
I tried reproducing the issue on codesandbox.io but it works fine there. That makes me think that something in my environment is not comparable with material-ui. I am using electron-webpack to bundle my application, and am using typescript. I see no reason why this would cause the problem but if anyone can say otherwise I would appreciate any help.
So it seems like the problem for me was in the package.json. If I move
"#material-ui/core": "^4.2.0",
"#material-ui/icons": "^4.2.1",
from dependencies to devDependencies, it works fine. I have no idea why this would cause an error about react hooks, but at least there is a solution.
Check the full error message. You probably have multiple versions of react installed.

Transformer hangs in recent versions of React Native when using Baobab

I started my React Native project with version 0.12.0 and Baobab. Everything worked great until React Native 0.14.2. In any version since then, the transform in the packager stops at 98% and the JS load fails.
I have used some of the advice in this github issue to determine that it's transforming a file in Baobab (baobab/dist/update.js or baobab/dist/watcher.js in different runs).
I have confirmed that Baobab is the issue by creating a clean React Native 0.16.0 install and only putting Baobab in it (with the required require)
At this stage, I'm not sure whether I should raise an issue with React Native or with Baobab, so I'm looking for advice on how to get some sort of error message that I can use to debug the issue and work out what's going wrong.
Ok. Worked this out myself:
By adding debug=babel to the environment the packager is running in, I got a huge amount of output and hidden in there was an error that .babelrc in the baobab package had an optional entry and the React Native packager doesn't understand optional. I deleted the .babelrc from the baobab package and everything works.

Categories

Resources