React-native iOS app not running on terminal and Xcode also - ios

Hello I'm Beginner in React Native,
I've installed everything did they said.
Now I've created application using below command
react-native init TempApp
Application is created successfully
Now I try to run application using below command
npx react-native run-ios
I got below error
** BUILD FAILED **
The following build commands failed:
CompileSwift normal x86_64 /Users/encora/Documents/Paresh\ Workspace/React\ Native\ Projects/TempApp/ios/Pods/YogaKit/YogaKit/Source/YGLayoutExtensions.swift
CompileC /Users/encora/Library/Developer/Xcode/DerivedData/TempApp-fnxepatpnxxjncbfdflpymtfxxag/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/SysUio.o /Users/encora/Documents/Paresh\ Workspace/React\ Native\ Projects/TempApp/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
Even I try to run application from Xcode also, but I still get error in Xcode also.
Can anyone help me please how to run first react application on Mac

Try this -
Close the Xcode,delete node_modules folder and then run commands in project directory
npm install / yarn install
cd ios && pod install --repo-update
npx react-native run-ios
Option 3 is optional either run project from terminal or from Xcode

Related

react-native run-ios keeps on failing

after updating MacOS to Big Sur and since Legacy build is deprecated
react-native run-ios does not work anymore, I've tried so many solutions but no progress I've been suffering with this for around 3 days.
side note that build on xcode succeeded
versions:
react-native: 0.59.10
xcode: 12
and I'm using iPhone 11 simulator and I also tried a real iPhone 11 device
result of npx react-native run-ios
on simulator:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening myapp.xcworkspace
** BUILD FAILED **
The following build commands failed:
Ld /myapp/ios/build/Build/Products/Debug-iphonesimulator/myapp.app/PlugIns/myapp.xctest/myapp normal
(1 failure)
another one on the simulator:
info ** BUILD SUCCEEDED **
info Installing DerivedData/Build/Products/Debug-iphonesimulator/myapp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
error Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/myapp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
on device:
info ** BUILD SUCCEEDED **
info installing and launching your app on Menna’s iPhone...
info ** INSTALLATION SUCCEEDED **
but the application doesn't appear on the device and I don't know how is that even possible?!
any help would be appreciated
SOLVED
in xcode, go to Project Settings > change build system to new build system
click on Advanced, then choose Custom (Relative to workspace) and specify locations as following:
Products: build/Build/Products
Intermediates: build/Build/Intermediates.noindex
in vs code, open node_modules/#react-native-community/cli/build/commands/runIOS/runIOS.js
and change DerivedData/Build/Products/${configuration}-${device}/${appName}.app
to build/Build/Products/${configuration}-${device}/${appName}.app;
delete ios/build and DerivedData content
run react-native run-ios again
try:
sudo npm install -g ios-deploy --unsafe-perm
and next:
yarn ios --device "YOUR_DEVICE_NAME"

Run into error while executing react-native run-ios

Hi I have created a project using react-native and when I run the command
react-native run-ios
the build fails in the terminal with the following error:
**The following build commands failed:**
CompileC /var/root/Library/Developer/Xcode/DerivedData/albums-gnnqffkyfazehwcywcchxrdqkvpd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTText.build/Objects-normal/x86_64/RCTBaseTextInputView.o /ReactNative/albums/node_modules/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Try this:
cd ios
pod install
react-native run-ios
You can run your react native IOS app using XCode by following below steps:
1.Go to your App folder, then go to ios folder. You'll see a file named AwesomeProject.xcworkspace.
2.Open this file and it will open your App in Xcode.
3.Select the desired simulator and click the ▶️ button to run your App.

react-native-webview commands failed to compile, how to fix?

someone has fixed or saw this issue?
I'm using last version of (react-native) and also macOS Catalina.
I did install react-native-webview by yarn and after into the (./ios) folder I had install the pods.
So build failed, after react-native run-ios.
The following build commands failed:
CompileC /Users/mymac/Library/Developer/Xcode/DerivedData/Project-cnketoyhxyitfqbbcdkdvhpuajey/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-webview.build/Objects-normal/x86_64/RNCWebView.o /Users/mymac/Desktop/React/project/node_modules/react-native-webview/apple/RNCWebView.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Are you running the latest version of Xcode?
See react-native-webview issue #1399

React-Native error: Command PhaseScriptExecution failed with a nonzero exit code

I have recently started with React-Native and wanted to try a bluetooth connectivity library (https://github.com/innoveit/react-native-ble-manager)
Steps to create app and run on device:
react-native init myBluetoothHandler
cd myBluetoothHandler
npm i --save react-native-ble-manager
When I do this I see this log:
react-native link react-native-ble-manager
Which fails with this error log:
Just for a hit and try I ran step 3 again and this printed. And after that link command also worked.:
But I am not able to run the project from Xcode on my device. I see this error:
Same happened to me when I tried a different library: https://github.com/Polidea/react-native-ble-plx/issues/388
Use react-native init <project_name> --version 0.59.0. Do not use rc versions.

Build failing for 'ionic build ios' on OSX 10.12.1

So this is a brand new Mac Air.. running Sierra.
When i run
ionic build ios
i get
** BUILD FAILED **
The following build commands failed:
CompileC /Users/foo/Library/Developer/Xcode/DerivedData/homepocket-gtpsstxtfgknjdgahozlqhgfgmmi/Build/Intermediates/homepocket.build/Debug-iphonesimulator/homepocket.build/Objects-normal/x86_64/AppDelegate.o homepocket/Classes/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/foo/Library/Developer/Xcode/DerivedData/homepocket-gtpsstxtfgknjdgahozlqhgfgmmi/Build/Intermediates/homepocket.build/Debug-iphonesimulator/homepocket.build/Objects-normal/x86_64/MainViewController.o homepocket/Classes/MainViewController.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/foo/workspace/myproject_mobile/myproject/platforms/ios/cordova/build-debug.xcconfig,-workspace,myproject.xcworkspace,-scheme,myproject,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 5s,build,CONFIGURATION_BUILD_DIR=/Users/foo/workspace/myproject_mobile/myproject/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/foo/workspace/myproject_mobile/myproject/platforms/ios/build/sharedpch
I installed latest xcode via apple store.
I set the machine to dev mode via xcode ide.
I've ran the emulate through xcode.
I can successfully 'ionic build android' as well as emulate.
I've also run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Because i was seeing
Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
.. mind you all of this is a fresh box from Apple.
After finding this.. https://forum.ionicframework.com/t/cordova-cdvviewcontroller-h-file-not-found-in-xcode-7-1-beta/32232/47
The solution for me was ...
ionic platform remove ios
ionic platform add ios#3.9.2
ionic prepare ios
Then i could build ios.

Resources