React native runnig error on ios device - ios

I am trying to run react native code to iphone, however it shows the following message.
The following code runs on Android normally, and on expo fine too, but it does not run on physical device.
Please help me.
E:\reactnative\cd webview
E:\reactnative\webview>react-native run-ios
Scanning folders for symlinks in E:\reactnative\webview\node_modules (38ms)
Found Xcode project webview.xcodeproj
spawnSync xcrun ENOENT
E:\reactnative\webview>

If you are using react-native-cli version 0.1.7 then you could either
Rollback to 0.1.7 (do not use '--verbose' argument)
npm install -g react-native-cli#0.1.7
or try it with the latest which might be fixed
npm uninstall -g react-native-cli
npm install -g react-native-cli
There was a regression in 0.1.8, reported here: https://github.com/facebook/react-native/issues/5169

Related

How to make sure expo knows SDK is installed in my laptop

I am currently making a react native app and have installed expo but I am getting the error below in the image. I have SDK(29) in my device but how do I make sure that expo knows it.
You don't seem to have made Expo a project.
Did you ran react-native init ??? If yes, it is not an Expo project. it is only react-native project
To make sure that Expo is installed properly: Verify that the
installation was successful by running expo whoami.
If you want an Expo project, run the following command.
expo init AwesomeProject
cd AwesomeProject
npm start # you can also use: expo start
The project you received from Git seems to be a React-native project.
You can try this command.
cd gitproject
npm install
cd ios
pod install
cd ..
npx react-native run-ios or run-android
In the terminal run
expo --version
if installed it will return the version like
5.2.0
else you will get
'expo' is not recognized as an internal or external command,
operable program or batch file.

UnhandledPromiseRejectionWarning: xcodebuild was not found

Recently I created an app in ionic and I wanted to test it in ios. So I run the command ionic cordova emulate ios . But, It is giving me following error.
(node:4200) UnhandledPromiseRejectionWarning: xcodebuild was not found. Please install version 7.0.0 or greater from App Store
I also run following commands but it still shows same error.
npm install -g ios-sim
and
npm install -g ios-deploy
Please guide me what to do.
NOTE: I am using Ubuntu 16.04
You are getting an error because you are running this command on Linux you need macOS to run this command. Hope this will help you :)

Errors building & emulating iOS with Ionic 2 App

I can't seem to be able to build or emulate in iOS. Xcode is up to date.
This is what I've tried so far:
reinstalling npm
ionic hooks add
sudo remove ios
sudo add ios (got errors when trying to emulate and build)
sudo remove ios
Adding ios without sudo (still errors trying to emulate and build)
npm install -g ios-sim
chown -R username .config/, files belong to me or root
It says iOS platform isn't installed when it definetly is.
I also don't understand how to unlink '/Users/sh/Desktop/PT/www/build/app.html'?
The screenshot below is for emulate but I get the exact same errors for build as well.
This fixed EACCES error:
sudo chown -R username /Users/username/desktop/folder
This allowed it to build and emulate correctly by installing again:
sudo npm install -g cordova
However it is not coming up correctly in the emulator but that wasn't the scope of this particular question. The emulator does launch from the command line now.

You may not have the required environment or OS to run this project - Cordova - iOS

I'm working with Cordova to build my mobile app. I'm working on a Mac machine and when I try to build and run my app on iOS device, but I'm keep getting this error.
When running:
cordova build ios
output:
** BUILD SUCCEEDED **
then I run
cordova run ios
I get the error
.../ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
If I try to open the project in Xcode and run it, it successfully run on the device.
I notice that before the run failed, it output the message
ios-sim was not found. Please download, build and install 'npm install -g ios-sim'
I'm guessing Cordova thinks the device isn't plugged in since the ios-sim is a simulatur plugin for cordvoa. But I may be wrong.
Any ideas?
(This question is similar to Cordova: You may not have the required environment or OS to run this project, but this question regarding iOS there that Android)
try
npm install -g ios-sim
npm install -g ios-deploy
I suggest you read iOS Platform guide for more info.

How to run project from Terminal in Ionic + iPhone?

MacBook-Pro:myApps naveenkumar$ ionic run ios
Adding in default Ionic hooks
Running command: /Users/naveenkumar/Documents/ionic_work/myApps/hooks/after_prepare/010_add_platform_class.js /Users/naveenkumar/Documents/ionic_work/myApps
add to body class: platform-ios
Running command: /Users/naveenkumar/Documents/ionic_work/myApps/hooks/after_prepare/020_remove_sass_from_platforms.js /Users/naveenkumar/Documents/ionic_work/myApps
Running command: /Users/naveenkumar/Documents/ionic_work/myApps/platforms/ios/cordova/run
Cordova needs ios-sim version 3.0.0 or greater, you have version 1.9.0
.
ERROR running one or more of the platforms: Error: /Users/naveenkumar/Documents/ionic_work/myApps/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
MacBook-Pro:myApps naveenkumar$
Hello,
I am trying to run my project from terminal. I am getting the above error. But when I go to given iOS directory run my project from Xcode it works fine. That means, when I run from Xcode I am able to run emulator /simulator and check my output. But when I run from terminal I am not able to run my application. Could you please tell me how I will run my application from terminal?
Thanks
This is the issue:
Cordova needs ios-sim version 3.0.0 or greater, you have version 1.9.0
Here is the solution:
npm update -g ios-sim
The issue is that you do not have ios-sim installed.
From the ionic framework website, you can see the following statement:
Note: iOS development requires Mac OS X. iOS simulator through the Ionic CLI requires the ios-sim npm package, which can be installed with the command sudo npm -g install ios-sim.
All you need is to install ios-sim by running this command:
sudo npm -g install ios-sim
simctl was not found.
Check that you have Xcode 7.x installed:
xcodebuild --versionCheck that you have Xcode 7.x selected:
xcode-select --print-path

Resources