Project 'react-native-reanimated' not found in root project - react-native

In my react native project I don't have "react-native-reanimated" but when I rebuilt my project I got this error:
"Project "react-native-reanimated" was not found in the root project
So when I install ‍react-native-reanimated‍ I get an NDK install error, but when I install the ndk and get the apk from the project, the app won't open and crashes.
So I uninstalled react-native-reanimated and ndk and cmake but again I got the error "project 'react-native-reanimated' was not found in the root project"
please help me
Android Studio Error Message Picture

Possible gradle related issue - try out the solutions in this post:
Android: Project 'MyProject' not found in root project 'MyProject'
But basically, delete the .gradle folder in your project's root folder and resync gradle from Android Studio.

try to run below command
npm install --force react-native-reanimated
Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
it work for me

Related

problem with expo react native navigation

i am using react-native with expo to run my app on my android devices when i load my app on my terminal i have this error
Some dependencies are incompatible with the installed expo package version:
#react-native-community/masked-view - expected version: 0.1.10 - actual version installed: 0.1.11
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo install [package-name ...]
Missing package "metro-config" in the project at: C:\Users\kabore\Desktop\react_native\app1
This usually means react-native is not installed. Please verify that dependencies in package.json include "react-native" and run yarn or npm install.
Error: Missing package "metro-config" in the project at: C:\Users\kabore\Desktop\react_nativ
simply remove the node_modules folder and run yarn install or npm install in the command line to install dependencies again .it seems like some of your dependencies are not installed correctly

#<WeakSet> could not be cloned

I have a React Native application that I recently updated.
However, on the majority of my modules, I have this error:
#<WeakSet> could not be cloned.
For example, on the module : #react-native-mapbox-gl
When I launch my application, I get the error :
node_modules\#react-native-mapbox-gl\maps\javascript\modules\snapshot\snapshotManager.js: #<WeakSet> could not be cloned.
I also have it on my react-native-vector-icons module.
Is this a common problem?
Thank you!
stop metro
reset repo
reinstall node_packages
run pod install --repo-update
Try deleting node_modules and reinstall with npm install or yarn install again, and then:
IOS:
pod update SDWebImageWebPCoder
pod install --repo-update
build project in Xcode
Android:
Open in Android Studio and Refresh Gradle Dependencies.
build project in Android Studio

why package dependencies not working even they are installed?

I created a package which uses react-native-webview as a dependency and I published it to npm.
My steps to create and publish a package are:
npm init
npm link react-native-webview
npm install react-native-webview
npm publish
Everything worked perfectly and I successfully published my package.
However, after the installation of my package using npm install <package_name> in another project, when I run the project I always get this error:
requireNativeComponent: "RNCWebView" was not found in the UIManager
I don't know why I am getting this. I also checked the dependencies in node_modules folder and all are present. But when I install react-native-webview dependency explicitly into my project It works perfectly fine.
This error is due to native link not present in between the UIManager and the JS core
You can either run react-native link react-native-webview or link it manually
use react-native link command to link dependencies
run
npx react-native link react-native-webview

react-native link can't find my MainApplication.java file

Every time I try to react-native link a new library, I get the same error message. Here it is for react-native-video.
rnpm-install info Linking react-native-video android dependency
rnpm-install ERR! Something went wrong while linking. Error: ENOENT: no such file or directory, open '/Users/Me/Projects/myProject/android/app/src/main/java/com/companyName/appName/MainApplication.java'
Please file an issue here: https://github.com/facebook/react-native/issues
The actual location of my MainApplication.java file is
./android/app/src/main/java/com/appName/MainApplication.java
The difference is that React Native Link is including "company name" in the path, which doesn't match my project.
How can I fix this?
I looked over some topic and found solution, you can try with:
npm install --save-dev babel-plugin-module-resolver
and then add your npm install package & react-native link again.
Good luck
I'm pretty late to the party on this, but for future reference;
TLDR: Adding another folder like so java/com/companyName/AppName/ will fix your issue.
After updating to the latest react-native I had this issue too. Your android path contains your apps ID so com.test.app path should be android/app/src/main/java/com/test/app.
Looking at your error message, its actually telling you where it's expecting the file to be;
Error: ENOENT: no such file or directory, open '/Users/Me/Projects/myProject/android/app/src/main/java/com/companyName/appName/MainApplication.java'
If you create another folder like so java/com/companyName/AppName/ you will be able to automatically link plugins.
Another way I tried and it works for me:
rm -rf node_modules && npm install
Then retry install your package:
ex:
npm install react-native-image-picker#latest --save
Then react-native link your package
react-native link react-native-image-picker
There are only two options that i am aware of to solve this problem
close all the terminals to stop the node server running on a difference terminal.
If you still have the mistake after that then try the following option
You might still have the error because you uninstall and re-install react-native without paying attention to the version that you installed which for most case will be the latest version. So double check the current version of your react-native when installing it. "\n"
so either
in your package.json you add "react-native": "^0.60.5" if the version is 0.60.5 replace "^0.60.5" by the version you are trying to run, in devDepencies and run npm install
or
run npm install react-native#0.60.5 or npm install react-native#version

Unknown plugin specified in .babelrc, attempted to resolve relative to path

So I've started a new react-native project and copied over the .babelrc file from my previous project. I've installed the necessary plugins but I'm getting the error
Unknown plugin transform-decorators-legacy specified in .babelrc, attempted to resolve relative to "/mypath/project"
I've checked the node_modules in the path and see that the plugin was installed using yarn add. I'm also getting similar errors with my eslint plugins. Am I missing something in my project setup to have babel and eslint see the node_modules?
Is it perhaps caused by installing react-native-code-push? I think it had some errors when I installed codepush where it duplicated the react pod in the pod install - and so I removed it from the podfile. Is it trying to use a cached code-push js even though I don't have code push implemented in my react js files?
trasnform-decorators-legacy
You have a typo here.
try this :
yarn add babel-plugin-transform-decorators-legacy -g
for NPM :
npm install --save babel-plugin-transform-decorators-legacy