i use 'npx react-native init ***' ,then the ios pods file size is so large , why? does anyone know
enter image description here
use npx react-native init
i'm so Confused
Related
When I try to start my react-native init project with this command npx react-native start nothing happens in the emulator.
enter image description here
Command npx react-native start is for starting up the bundler (Metro)
to run it on an android emulator or device you need npx react-native run-android.
Before that please make sure you have either a real device connected or an emulator ready.
You can follow or check by using this guide for your Android environment setup.
Is react-native eject is not working anymore ? is it completely removed from the react-native? I am using react-native version 0.60.0.
I can't even find it in the react-native help.
Please check the image for more reference:
Same here. In this moment, have a brand new backup of your project and then copy the android and ios folder, is the better way to regenerate those folders... unfortunately
UPDATE
react-native upgrade --legacy true
Firstly you would need to install react-native-eject then you can run react-native eject.
Simply do these:
npm i react-native-eject
or
yarn add react-native-eject
then run:
react-native eject
Yes, the eject command was removed from react-native recently (March 28, 2019).
React Native had this command in the previous version. Running this command will check if the ios and android directories exist and then rebuild whichever one is missing.
react-native eject <=0.59.0
Now you should use the react-native upgrade --legacy true command to back up your android folders or ios as the case may be as this command will replace your files.
react-native eject has been deprecated use npx react-native eject its working
eject isn't part of react-native, but rather expo. To eject, you can run:
npm run eject
I am trying to recreate ios and android folders for my react-native project. As far as I know this is done with the command:
react-native eject
But I get the error:
error Unrecognized command "eject".
I am doing something wrong? How should I recreate android and ios folders?
react-native-cli: 2.0.1
npm i react-native-eject
npm i #react-native-community/cli
react-native eject
will generate the both android and ios folder
It did work in 0.59.9. This threw me too this morning after I upgraded to 0.60. Apparently you now have to run react-native upgrade --legacy true. react-native eject was much easier IMHO.
yarn add react-native-eject
react-native eject
This two-line of code solved my problem with the eject error.
Nikita is 100% correct. If the project was initialized in expo running react native eject will "eject" the project from the expo dependencies (and expo environment) and create a standalone react native project outside the expo environment. This typically adjusts the dependencies in the pakage.json file.
The command exists as a part of expo.
To initialize a project from scratch react-native init will create android and ios folders. Also ensure if you have cloned the directory to run either npm install or yarn to install the dependencies.
If the project was initialized the way I imagine yours was the commmand you are looking for would be one of the following:
react-native run ios or react-native run ios --device
react-native run android or react-native run android --device
For RN projects, which are initiated by react-native init there is no such command, by default RN is using metro bundler instead of web-version of React, where you can configure Parcel/Webpack/Rollup or run create-react-app where actually you can eject.
This question is suitable for expo where you can actually eject, if you need some native modules that are not included in expo.
Try to use expo
react-native eject and upgrade --legacy true aren't working for me.
In the end, I just created a new blank RN project and this had an ios folder. Copied the folder over to my existing project and ... seems to work.
Run npm i react-native-eject
Run npm i #react-native-community/cli --force
Note: use npx instead of npm
npx react-native eject
cd android
./gradlew.bat installDebug
cd..
npm run android
I am running $react-native run-android. it is working properly, also, I am able to see the changes on android emulator. I have created 3 components and also tested it on android device.
But now, suddenly, it is asking me unable to load script from assets 'index.android.bundle' Also, I have reverted the changes and started but still I am seeing this error.
After serching on internet, I performed,
1. npm start
2. react-native start
3. adb kill-server and adb start-server
but all in vein.
Last, I found and performed below commands,
$ mkdir android/app/src/main/assets
$ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
$ react-native run-android
I am able to resolve above error with above commands, but now, when I am changing App.js file, it is not getting reflected on emulator. please help.
My steps performed: http://sachin4java.blogspot.in/2017/12/unable-to-load-scripts-from-assets.html
I have tried many things as found on internet, but no one worked.
I removed installed node, NPM and nodejs
I installed it again with : http://sachin4java.blogspot.in/2017/12/react-native-setup-in-ubuntu-16.html
Then I installed in new version in Android studio AVD image named 'Nexus_5X_API_26(AVD)'.
Now, I am able to see the code changes reflecting and red error screen gone.
I'm new to React and React-Native I'm trying to open a React-native app I cloned from github. I've done a npm install and I did a npm start in the command line. It says: "Running Packager on port 8081" and then a bunch of other builds beneath it. I tried going to local host 8081 and 8081/hot but I can't see the app. Does anyone know how to run and test an react-native app on the browser?
follow the below step
1) Go to project directory
after use this CLI
2) react-native run-android
it can run only either emulator or real device so we can first start the emulator after the try above command
more details see this doc
Inside your project directory for bundle js.
3) react-native start
or
3) react-native start --reset-cache
After installing packages,
open src folder--->open in terminal
--->$ npm start
react-native run-ios --simulator="iPhone 5s"
If you have an installation with android and ios folders, you should run yarn android or yarn ios.