Screenshot of npx react-native doctor:
As you can see, the iOS is all green ticks. I npm start in a terminal tab to run react native metro server. I then open another terminal and npm run ios Yes, the simulator opens straight away, but then I get a long error: https://pastebin.com/6bFTMDTr
I cd ios then pod install and got this:
Anyone have any idea?
Have you tried installing the pod dependency manually?
$ cd iOS && pod install
upd.
Looks like you haven't installed Ruby
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ruby
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
after that install a watchman depend
$ brew update
$ brew install watchman
upd2.
1) brew reinstall cocoapods
(error message will come up regarding linking)
2) brew link --overwrite cocoapods
(to fix the link)
Related
I tried to run an existing react-native project on mac to create ios build but i've been getting into an unusual error as mentioned below. I don't know what RCT-Folly does as i am new to react-native but i think the error is related to RCT-Folly, I tried many other stack answers but couldn't solve it
Here is a picture of the error
I have tried the other solution like creating a fresh projects and copying files, also tried reinstalling cocoapods,
If there is some other thread that you guys think i should try please let me know
Stuck at this for more than 3 days now!
Update:
After downgrading react native version it is now showing this error:
CompileC /Users/admin/Desktop/MTM/mindToMindfull\ 2/ios/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/Objects-normal/x86_64/RCTJSThread.o /Users/admin/Desktop/MTM/mindToMindfull\ 2/node_modules/react-native/React/Base/RCTJSThread.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-Core' from project 'Pods')
RCT-Folly is an iOS Cocoapod library. Try cleaning your project first. From the project root, run (for Yarn)
watchman watch-del-all && rm -f yarn.lock; rm -rf node_modules,
then
yarn
cd ios && rm -rf ~/Library/Caches/CocoaPods Pods ~/Library/Developer/Xcode/DerivedData/; rm Podfile.lock; pod deintegrate; pod setup; pod install && cd ..
yarn ios
I haven't used npm in awhile. But for 2 and 4, use npm install and npx react-native run-ios
Solved by downgrading react-native version 0.66.4
then installing pods and build was a success.
i run an application React Naive with Expo, i'm using ubuntu operation system .
i did clone the project repo then run the command yarn install then i want run the project on the Expo go on my phone i run expo start the error below
expo start
Command 'expo' not found, did you mean:
command 'expr' from deb coreutils (8.30-3ubuntu2)
command 'expn' from deb sendmail-base (8.15.2-18)
Try: sudo apt install <deb name>
i have install node , watchman , Expocli
I think you didn't install expo-cli module globally.
Use this command for install expo-cli module.
npm i expo-cli -g
You can reference these URLs.
installing node module globally
installing expo-cli
How to setup up the development environment for React Native in Apple M1 ARM-based system?
RN Environment Set For Android & iOS :
Install home-brew (https://brew.sh)
/bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install node & watchman (from terminal)
brew install node
brew install watchman
Don’t use the wrong JDK for React Native if you’re using an M1 Mac
…or you’ll be going 2x as slow and not know why
*Reference (https://shift.infinite.red/dont-use-the-wrong-jdk-for-react-native-if-you-re-using-an-m1-mac-252533dd47a2)
Install SDKMAN (https://sdkman.io)
curl -s "https://get.sdkman.io" | bash
sdk list java (check the version you want to install)
sdk install java 11.0.14-zulu
*Using of Sdkman (https://towardsdatascience.com/install-and-run-multiple-java-versions-on-linux-using-sdkman-858571bce6cf)
Download and Install Android Studio
Select AS for Mac (https://developer.android.com/studio/preview)
Select the Mac with Apple chip
Android Studio installs the latest Android SDK by default.
Select latest Android SDK Command-line Tools (Preference > Android SDK > SDK Tools > show package details)
Add the following lines to your in your ~/.zshrc :
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
Note : To add this :
Open terminal & type nano $HOME/.zshrc
Copy that 5 lines and paste it
Control + O and then press return (to save).
Control + x (to exit)
Create project :
npx react-native init AwesomeProject
Run project :
npx react-native run-android - (to run in android)
Reaming Setup for iOS :
Install Xcode from Appstore
ruby -v (ruby is default installed)
Open terminal and type :
sudo xcode-select -switch /Applications/Xcode.app/Contents/ Developer
sudo xcode-select --install
brew install libffi
brew install cocoapods
Now to run iOS application
Simulator : npx react-native run-is
Device :
npm install -g ios-deployRun on a connected device, e.g. Max's iPhone:
react-native run-ios --device "Max's iPhone"
Anyone #with help on how to setup #reactnative #ide on #M1Macbookpro? Tried a number of YouTube tutorials but my problem begins when I start running "npx react-native init " and have problems installing cocoapods, even when I cd > install #dev #vscode
Followed the react native official installation guide all to no avail. Tried running terminal in rosetta to install cocoapods but still no results. Any help?
This is the error:
✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing CocoaPods dependencies (this may take a few minutes)
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./AwesomeProject07/ios && pod install".
CocoaPods documentation: https://cocoapods.org/
try to run pod install with this command
sudo arch -x86_64 pod install
also run this command too
sudo arch -x86_64 gem install ffi
running on my device used to work fine. However, suddenly,
when I run react-native run-ios --device,
I get to the ending like
[[ true != true ]]
** BUILD SUCCEEDED **
installing and launching your app on User’s iPhone...
However, nothing happens after and the app does not get installed in my device.
For me the following worked a while back when I faced a similar issue:
>npm install -g ios-deploy
>react-native run-ios --device "My iPhone"
I seriously offer you to install ios-deploy by using brew:
brew install ios-deploy
If you installed it by npm before installing by brew uninstall it by the following command:
sudo npm uninstall -g ios-deploy
After having the correct version with the correct installation plug your device and then run the below command:
npx react-native run-ios --device
This current command directly installs the app on the first plugged device to your macOS system. if you plugged several devices then you should pass the name of a targeted device just like below:
npx react-native run-ios --device "DeviceName"