I added a vector icon package in my React Native app. But After adding vector icon library I am trying to rebuild project using
**npm run android
react-native link**
But it's giving me an error
npm err missing script android react native
I have tried many solutions of updating package.json file from Github and I have tried to change the path of the environment but still same
I think you are using the wrong command to make debug build.
Following these steps:
install vector icon
link it from your project root directory using the command react-native link your_package_name
Use this command from your project root directory to make build react-native run-android
Related
I have tried to install app using
npx react-native init ProjectName
But it has just created package and node module files and not created Platform-specific folders like android and ios.
Try rerunning this command in another folder.
Check if there any errors in terminal where you ran that command
I have created a new React Native project using npx react-native ProjectName. When trying to start it with react run android, the Metro bundler starts but after a second it closes without displaying any error. This project was created with WebStorm that displayed in the project creation dialog that it used v2.0.1 of the cli.
I saw on github that this is a known bug of this version so I created another project manually with npx react-native#latest, but without any result.
Also, when trying to start the project with npm start I get this error:
Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class. Run CLI with --verbose flag for more details.
Any suggestions?
I am trying to create one react native app with Drawer navigation with menu in header using stack navigation like below
I have installed packages like below
1.npm install react-navigation
2.npm add react-native-reanimated react-native-gesture-handler react-native-screens#^1.0.0-alpha.23
3.npm add react-navigation-drawer
After that it's working as expected like below for drawer menu
then am trying to create menu in header by using stack navigation after executing npm install react-navigation-stack am getting below error while running app
sometimes after installing react-native-vector-icons also am getting same error, please help in this thanks in advance
try this;
open your cmd, navigate to your project directory
cd into android
then
run
./gradlew clean
then re-run the app or install the package you want like the ICONS one! and try
npx react-native run-android
that should help;
otherwise, see this link and follow steps to install multi dex and then repeat the above-said steps!
as a Side Note: you should! update android studio, plugins and
rebuild the app with latest android and Gradle
I would like to know if it's necessary to rebuild react native project after installing and linking libraries that includes native codes.
Yes, as react-native-link updates some native files that are under the ios/android folder, that won't be checked during a reload/hot-reload/live-reload. All those files aren't checked in your jsBundle and are compiled during a run-android or run-ios.
Of course, if you added a new dependecy to the project and linked it, and you haven't used it anywhere in your code yet, you don't need it. If you are using that dependecy, your project instance will, most likely, die.
if your react native version is below 0.60 then you have to run react-native-link after you install any react-native module. However after react-native version 0.60 and above, this is done automatically using the new "autolinking" feature added.
Read the changelog here:
https://facebook.github.io/react-native/blog/2019/07/03/version-60
However you still need to rebuild your project after you install a native module but you dont need to run the react-native-link command anymore after installing every library after react-native#0.60 and above. Just type react-native run-android
I have made a custom wrapper in android for react-native. When I am using react-native link to install dependancy in android for my Project, it is not doing any changes neither showing any errors. I have followed this document https://www.botreetechnologies.com/blog/how-to-build-a-react-native-android-bridge for same but I have to make changes in android files manually for my Module and package. Do I need to add build.gradle too in android directory? or any other file if I have missed. This is my file structure for bridge.
This is how I am importing my local package in another React Native package's package.json