how do I delete library clearly in react native? - react-native

I want to delete react-native-google-signin library.
so I remove it using 'yarn remove react-native-google-signin'
But when I bulid my app, it seems to be there.
How can I solve this error?

In your scenario, after removing library or package you need to do pod install after that for iOS..
SOLUTION
if you are using yarn
yarn remove react-native-google-signin
If you are using npm
npm uninstall --save react-native-google-signin
After that move into your ios folder using cd ios
Then run pod install using pod install
Finally, close existing workspace from XCODE and reopen and before run your project clean your project ( Command+Shift+K ) and run

Related

#<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

How to run pod file in iOS directory in react native?

error Could not find "Podfile.lock" at projects\reactNative\ios\Podfile.lock. Did you run "pod install" in iOS directory?
(node:11696) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
error Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues. Run CLI with --verbose flag
Issue 1
For fixing the issue:
Could not find "Podfile.lock" at projects\reactNative\ios\Podfile.lock. Did you run "pod install" in iOS directory?
Please make sure you have install cocoapods and run this command at your project root:
gem install cocoapods // If you haven't install cocoapods
cd ios && pod install && cd ..
Issue 2
For fixing the issue:
(node:11696) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use node --trace-warnings ... to show where the warning was created)
Please downgrade your node.js version to v13.x.x, one of the solutions below:
npm install -g n
sudo n 13.13.0
Issue 3
For fixing the issue:
Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues. Run CLI with --verbose flag
Please make sure you have installed Xcode correctly from App Store and use the latest React Native version in your project (should be v0.62.2 now for stable). If still cannot open the project, please try to add some simulator in Xcode's developer settings.
Cheers!
you did not install cocoapods
install cocoapods commands
sudo gem install cocoapods
after that in react native directory
cd ios && pod install && cd ../ && react-native run-ios
CocoaPods manages library dependencies for your Xcode projects. We need it to setup the iOS project. Like yarn
sudo gem install cocoapods
The Podfile is a specification that describes the dependencies of the targets of one or more Xcode projects. Like package.json
access to the folder with Podfile, run
pod install
This will resolve the code of those dependency framework, and generate Pods.xcodeproj for your iOS project.

What is the problem with 'react-native-elements'?

When I try to use 'react-native-elements' package in my code, I face this error :
bundling failed: Error: Unable to resolve module react-native-vector-icons/FontAwesome from node_modules\react-native-elements\src\social\SocialIcon.js: react-native-vector-icons/FontAwesome could not be found within the project.
I have done many things to fix it. I installed the 'react-native-vector-icons' again, I used 'rm ./node_modules/react-native/local-cli/core/fixtures/files/package.json' but non of them worked. what should I do to overcome this problem? I really appreciate your help guys.
make sure that you've installed the package with
npm install react-native-vector-icons and link it through
react-native link react-native-vector-icons
then for ios you need to install pod (goto your project ios folder on terminal and enter command pod install)
and then reset packager cache with react-native start --reset-cache
if you are using react version <0.60 use react-native link react-native-vector-icons and do the steps link and if react version > 0.60 then cd ios && pod install && cd .. and try again if its not work delete the build folder and rebuild again.

Error while running the existing React Native project

So I'm opening my the existing React Native project. This is the procedure on how I opened my existing React Native project. 1st step, type the location of my project which is in the "D:\rnprojects\firstproject\". 2nd step, "react-native-start". 3rd step, I opened another cmd then locate it again into my project directory then typed "npm start".
Why when I created this project I didn't get this error just when runnning/opening my existing project.
This the error that I got: (with versions)
There is only simple steps can solve your particular scenario issue quickly.
1) Install the React native cli in your project or globally.
npm install -g react-native-cli
OR
npm install react-native --save
then start your project by using this command
npm start
If any dependencies issue please follow the second solution
2) Please make sure you're installed all dependence
yarn install
OR
npm install
under your project directory
I'm pretty sure your issue will fix by using 1st solution Thanks.
it is simple:
1.npm install
2.react-native run-android
Here I guess you have the RN environment to run already on your side.
cd path_to_project
install packages(there are two following ways to install packages).
2.1 yarn install
2.2 npm install
react-native link(optional - you need to run this command if existing project use RN packages which need to link such as
react-native-vector-icons)
optional(if project use pods) cd ios pod install
react-native run-ios or react-native run-android according to the platform which you want to run on.
I don't think above is perfect instruction give you how to run the existing react-native project, But I am pleasure if give me some hints or help to you.
You can find official guide here
Sometimes npm's cache gets confused and need to reset it by using below command:
npm cache clean --force
Also try below command:
npm install --save-dev react-native-cli
Hope it will help you.

Setup a cloned react-native project created via react-native init command

I have created a react-native project XYZApp using react-native init which is pushed in GitHub repo.
Now when I am cloning the project on a different system. following is the directory structure
app/XYZApp
Following is the set of commands and steps I am using.
cd app
brew install node
brew install watchman
#
npm install -g react-native-cli
#
install android studio and required SDKs
#
install X-Code
#
react-native init MyApp
prompt: Directory MyApp already exists. Continue?: (no)
I am typing - yes
npm install [all dependencies]
react-native link
Through all the above steps, some new default files are getting created which runs a default app, with some minor changes in those files I am able to run the app. But I know this is not the correct way of doing this.
I tried several other methods also,
like npm start
I checked several links but could not find the correct method for the setup after cloning.
Most of them are mentioned for create-react-native-app method.
It will be great if someone can help me regarding this.
after cloning
Don't do this
react-native init MyApp
prompt: Directory MyApp already exists. Continue?: (no)
I am typing - yes
npm install [all dependencies]
react-native link
just go to cloned app directory XYZApp and do
npm install
and all set to run the app using
react-native run-android
Update 2019 React Native 0.60.0+:
First you need to install all the node modules by running
npm install
If you're using libraries with native dependencies like react-native-gesture-handler these libraries need to be linked correctly. To do so run
react-native link
For setting up the iOS project correctly you need to install the CocoaPods dependencies:
cd ios && pod install