Nativescript Tutorial: error with livesync - nativescript

I'm running on macosx with nativscript 2.0 (typescript+angular2 tutorial).
I just ran the tns run ios --emulator command and then ctrl-c.
Then running this command: tns livesync ios --emulator --watch
results in:
.
.
.
Transferring project files...
Successfully transferred all project files.
Applying changes...
**Error Command failed: killall sampleGroceries2.app
No matching processes belonging to you were found
while executing killall sampleGroceries2.app.**

I have tested the {N} + Angular2 tutorial and afer following the instruction I had no problems with the livesync option.
Have you updated to NativeScript 2.0.0 - I have noticed that this error was logged in the previous version 1.7.1.
If you need to update your NativeScript version globally you can run
npm install -g nativescript
After that step you can remove/add the platform folder from your project with the following commands
tns platform remove ios
tns platform add ios
Also delete the node_modules folder and the re-run
tns run ios --emulator
To check your current NativeScript version you can execute
tns --version
The latest official release of {N} has some livesync fixes so now your command should run as espected - let us know if that solution was appliable for your case.

Related

XCode 14.0.1 error build: Command PhaseScriptExecution failed with a nonzero exit code (React Native project)

I'm trying to run my React Native project on XCode so that I can get it to run on my iOS device, everything works perfectly fine in VS Code and the Simulator software, but XCode simply refuses to build the project, throwing the error:
error build: Command PhaseScriptExecution failed with a nonzero exit code
This error occurs even when I try running an untouched new project (the example init project from react-native).
I tried these solutions:
deintegrating and reinstalling pods
running this command: npx react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ./ios/main.jsbundle
Locking and unlocking the "login" keychain, I wasn't able to lock the keychain in the first place, the option is greyed out. What could cause that?
run pod install in the ios directory
I use:
XCode 14.0.1
M1 Macbook Air
MacOS Big Sur 12.6
React Native 9.1.3 (at least that's what npx react-native -v says, but node modules -> react-native -> package.json in my project says it's 0.70.1)
If there are any more details you need please let me know, thanks.
EDIT: Here's a screenshot of the build's report in the report navigator
screenshot

react-native run-ios fails to build

I have an existing project, that have been tested on an windows + android setup. Now I'm trying to run it on a macbook to test on an Iphone 11 simulator.
react-native-cli: 2.0.1
react-native: 0.64.0
I install the pod file and try to run
react-native run-ios
I get a the following error:
** BUILD FAILED **
The following build commands failed:
CompileC [USER]/Library/Developer/Xcode/DerivedData/andon-hkuetryxdipcrgbcxnseaqnfnaqp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactCommon.build/Objects-normal/x86_64/RCTTurboModuleManager.o [PROJECT_PATH]/node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
I encountered this problem while running a React Native iOS app on macOS. After researching the issue for hours I was able to resolve it with these steps:
Clear the cache of pod by running these commands:
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
Navigate to the ios directory, and delete the Pods directory
While still in the ios directory, run pod install
Navigate back to the project directory, and run npx react-native run-ios
Hope this helps you too!
Probably very late to answer.
I started facing this issue after I upgraded from 0.63.4 to 0.64.2.
If we run from command line was not getting any way to find out the error. When I ran from x-code, found following error message,
/node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm:172:8: 'shared_timed_mutex' is unavailable: introduced in iOS 10.0
The reason for that was the following entry in my podfile,
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
After I deleted the above entry it started working like a charm.
ref: https://github.com/facebook/react-native/issues/31250#issuecomment-808312355
Under XCode top menu, Goto XCode->Preferences -> Locations -> Open
Derived Data folder(By clicking the arrow button) (Find screenshot
for your references)
Finder will open Derived Data folder,
Delete Derived Data Folder
Start Metro server using npm start or yarn start
Perform Clean build using cmd+shift+k
Run the application using cmd+r

project run in iOS simulator, but did not build project in react native

warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'Flipper' from project 'Pods')
** BUILD FAILED **
The following build commands failed:
Ld /Users/ramprasadsarkar/Library/Developer/Xcode/DerivedData/AwesomeProject-edxfscsdfjwsmicnfanfokvrokke/Build/Intermediates.noindex/AwesomeProject.build/Release-iphonesimulator/AwesomeProject.build/Objects-normal/arm64/Binary/AwesomeProject normal arm64
Please try the following.
If you are using terminal then set directory to your app folder.
or if you are using Vscode just open the terminal.
I hope you have already installed node.(did basic setup).
In terminal add follwing commands one by one, means use next commands only after completing 1 st command run.
npm install
cd ios
pod install
cd ..
npm run ios or npx react-native run-ios
Just check it works.

Flutter desktop embedding

Following these instructions
I tried to run a new project on macOS(desktop) using Android Studio.
I get the following error:
Launching lib/main.dart on macOS in release mode... Finished with
error: Unable to get Xcode project information: xcodebuild: error:
The directory
/Users/current.user/Work/Playground/testout/flutter_app2/macos does
not contain an Xcode project, workspace or package.
I get the same issue if I run in the terminal flutter run --release -d macOS
Running on a simulator/device, works fine.
It doesn't sound like you followed the instructions for running a project other than the FDE example. A newly created Flutter project doesn't have support for running on desktop; you need to add that.
See also flutter.dev/desktop#create for information on the state of create and run for desktop.

I cant get my ionic app to open in iOS emulator

My new ionic app won't run in the iOS emulator.
Its a fresh install of ionic and Xcode, these are my steps:
npm install -g ionic
ionic start myApp tabs
ionic cordova platform add ios
ionic cordova build ios
ionic cordova emulate ios
Then I get the following error:
No target specified for emulator. Deploying to undefined simulator
/localhost/myApp/platforms/ios/build/emulator/MyApp.app/Info.plist
file not found.
According to this thread (Fresh Ionic Fails to Emulate iOS 12 - Info.plist file not found) it should work with the following command:
ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"
But then I get the following error:
No target specified for emulator. Deploying to undefined simulator
Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.
And then according to this thread (Issues starting iOS simulator from CLI) it should work by updating ios-sim like this:
cd platforms/ios/cordova && npm install ios-sim#latest
But I still get the following error:
No target specified for emulator. Deploying to undefined simulator
Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.
Ionic:
ionic (Ionic CLI) : 4.10.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : #ionic/angular 4.0.1
#angular-devkit/build-angular : 0.12.4
#angular-devkit/schematics : 7.2.4
#angular/cli : 7.2.4
#ionic/angular-toolkit : 1.4.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : ios 4.5.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 4 other plugins)
System:
ios-deploy : 1.9.4
ios-sim : 7.0.0
NodeJS : v10.15.1 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
The problem lie with ios-sim package which couldn't detect running simulators.
Updating to 8.0.1 with the following steps resolved the issue for me.
force update ios-sim to a working version
IMPORTANT needs to be done from inside the platforms/ios/cordova directory.
cd platforms/ios/cordova && npm install ios-sim#8.0.1
check if devices are now listed, takes a few seconds
ionic cordova emulate --list
installs appscript if not installed already
ionic cordova build ios
try to deploy to simulator
ionic cordova emulate --release --prod --livereload ios -- --buildFlag="-UseModernBuildSystem=0"
This will find any running simulator and deploy the app
Try just building the project and then running it from Xcode instead first.
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
Then open the platforms/ios folder in Xcode and you'll be able to run it from there plus see any errors there may be with the project. When you eventually decide to push the app to the store you'll need to do this anyway.
EDIT
Then try targeting a specific emulator:
ionic cordova emulate ios --list get list of available targets to copy into the next command.
ionic cordova emulate --livereload ios -- --buildFlag="-UseModernBuildSystem=0" --target="iPhone-X, 12.1" example targeting iPhone XR.
The issue is related to a breaking changes on Xcode 10 not already reflected on ios-sim. You can check on ion-sim repo issue "List empty of devices simulator with Xcode 10".
The issue have already been fixed but is waiting for a new release submission.
You can continue running your App on emulator directly from Xcode.

Resources