React Native is a great library for building awesome applications.
But sometimes after downloading a project from Github or moving that project around from directory to directory, you’ll find that it throws off some reprehensible error.
This also seems to be common problem with projects that make use of Node Package Managers. So here are some of the steps you can take to troubleshoot this problem.
This is one of the crucial steps you should take especially when you have just downloaded a new React or React Native project.
The “node_modules” folder contains information about the library configurations that you have used for your project.
Some of these libraries are installed based on system configuration which apparently differs from system to system. So what you want to do is to delete that folder and re-install it
Depending on whether you are using yarn or npm for your project (although yarn seems to be more favoured and recommended), after deleting your the “node_modules” folder, you should go to terminal and at the root of your project run the following command:
yarn install
//or
npm install
//Don't run both Running any of the above command will immediately re-install the node_modules folder along with other specified dependencies in the package.json file.
The iOS version of your React Native project or app relies heavily on Cocoa-pods to manage all dependences used by your project.
CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. You can read more about getting started with Cocopods here.
Meanwhile, for an already-existing project you can run the following command on your terminal:
cd ios
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod install Sometimes when compiling your React Native project for Android, you’ll get the DebugManifest Failed Error.
This usually occurs because Jdk is not properly configured. What you can try is to check your jdk version and try to export it to your Java_home directory.
First, check for your jdk version:
/usr/libexec/java_home -V
Next, export to java_home directory:
export JAVA_HOME=`/usr/libexec/java_home -v 15.0.2` //replace with your correct version React Native is a great library, but it’s also far from perfect (Do we really have perfect anything?)
More efforts and upgrades are being put in place to ensure it best serves its purpose, which is build native apps fast and easy.
Latest tech news and coding tips.
Why borrowing code is a skill—when you understand what you're copying. For years, "copy-paste developer"…
Interactive forms rarely keep every field active all the time. Sometimes an input should only…
A modern JavaScript API for working with dates, times, time zones, and calendars without the…
Understanding What Happens Behind the Scenes Node.js looks simple from the outside—you write JavaScript, call…
The need for absolute certainty is the greatest disease the engineering mind faces. The moment…
The software industry is one of the most competitive places to build a career. Every…