NativeScript CLI (8.0.2) on Apple M1 CPU/MBP
When running ns run iOS I get this error.
error
'arch install' command failed.
I've tried running it from Rosetta Terminal & (installing Rosetta 2).
Any ideas?
tns prepare ios --log trace
Installing pods...
Running on arm64 - running pod through rosetta2.
spawn: arch "-x86_64" "pod" "install"
arch: posix_spawnp: pod: Bad CPU type in executable
Result when throw error is false:
{ stdout: '', stderr: '', exitCode: 1 }
'arch install' command failed.
Error: 'arch install' command failed.
at Errors.failWithOptions (/opt/homebrew/lib/node_modules/nativescript/lib/common/errors.js:157:27)
at Errors.fail (/opt/homebrew/lib/node_modules/nativescript/lib/common/errors.js:130:21)
at CocoaPodsService.<anonymous> (/opt/homebrew/lib/node_modules/nativescript/lib/services/cocoapods-service.js:55:30)
at Generator.next (<anonymous>)
at fulfilled (/opt/homebrew/lib/node_modules/nativescript/lib/services/cocoapods-service.js:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Have you tried installing an older version of cocoapods?
For me installing 1.10.2 instead of 1.11 fixed the issue for me.
Related
i use expo build:android -t apk to build apk file
but always receive below error.
May i know why ? it started happen yesterday. Pervious builds are ok using same expo sdk44. so far ios build is always ok so far.
i logout /in expo cli and try , but not able to build. i try with different expo account also cannot.
Anyone can suggest based on below error log ?
Thank you in advance.
my Environment
expo-env-info 1.0.3 environment info:
System:
OS: Windows 10 10.0.19043
Binaries:
Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 4.0.0.0 AI-193.6911.18.40.6514223
npmPackages:
babel-preset-expo: 9.0.1 => 9.0.1
expo: ^44.0.6 => 44.0.6
react: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
react-navigation: ^4.3.1 => 4.4.4
Expo Workflow: managed
Error: Request failed with status code 500
at createError (/app/turtle/node_modules/axios/lib/core/createError.js:16:15)
at settle (/app/turtle/node_modules/axios/lib/core/settle.js:17:12)
at RedirectableRequest.handleResponse (/app/turtle/node_modules/axios/lib/adapters/http.js:231:9)
at RedirectableRequest.emit (events.js:387:35)
at RedirectableRequest.emit (domain.js:470:12)
at RedirectableRequest._processResponse (/app/turtle/node_modules/follow-redirects/index.js:426:10)
at ClientRequest.RedirectableRequest._onNativeResponse (/app/turtle/node_modules/follow-redirects/index.js:57:10)
at Object.onceWrapper (events.js:482:26)
at ClientRequest.emit (events.js:375:28)
at ClientRequest.emit (domain.js:470:12)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:647:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
at HTTPParser.execute (<anonymous>)
at TLSSocket.socketOnData (_http_client.js:515:22)
at TLSSocket.emit (events.js:375:28)
at TLSSocket.emit (domain.js:470:12)
at addChunk (internal/streams/readable.js:290:12)
at readableAddChunk (internal/streams/readable.js:265:9)
at TLSSocket.Readable.push (internal/streams/readable.js:204:10)
at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)
I set up appium tests following nativescript-dev-appium instructions (https://github.com/NativeScript/nativescript-dev-appium) and tests run fine on an Android simulator.
My problem is on iOS. I cannot make them work, before and after methods fail with the error Cannot read property 'statBarHeight' of undefined. Here are my logs :
➜ npm run e2e -- --runType sim.iPhone11Pro --reuseDevice
> my-project#1.0.0 e2e /Users/fleebzz/workspaces/xxx/my-project
> node ./node_modules/nativescript-dev-appium/check-dev-deps.js && mocha --opts ./e2e/config/mocha.opts "--runType" "sim.iPhone11Pro" "--reuseDevice"
Parsed args: {"port":4723,"projectDir":"/Users/fleebzz/workspaces/xxx/my-project","projectBinary":"/Users/fleebzz/workspaces/xxx/my-project/node_modules/.bin","pluginRoot":"/Users/fleebzz/workspaces/xxx/my-project/node_modules/nativescript-dev-appium","pluginBinary":"/Users/fleebzz/workspaces/xxx/my-project/node_modules/nativescript-dev-appium/node_modules/.bin","wdaLocalPort":8410,"testFolder":"e2e","runType":"sim.iPhone11Pro","appiumCapsLocation":"/Users/fleebzz/workspaces/xxx/my-project/e2e/config/appium.capabilities.json","verbose":false,"cleanApp":false,"path":"/Users/fleebzz/workspaces/xxx/my-project","capabilitiesName":"appium.capabilities.json","driverConfig":{"host":"localhost","port":4723},"logImageTypes":[]}
/Users/fleebzz/workspaces/xxx/my-project/e2e/config/appium.capabilities.json
Capabilities found at: /Users/fleebzz/workspaces/xxx/my-project/e2e/config/appium.capabilities.json
Automation name set to: XCUITest
To change automation name, you need to set it in appium capabilities!
Application full path: /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa
The started device will be killed after the session quits!
To avoid it, set 'fullReset: false' in appium capabilities.
Is process Simulator.app alive: true
xcrun simctl create "iPhone-11-Pro" "iPhone 11 Pro" "com.apple.CoreSimulator.SimRuntime.iOS-13-5"
Remove: 76B308BE-409C-4A0A-8679-36F670F59118
Check if simulator is booted!
Simulator is booted!
Launched simulator with name: iPhone-11-Pro; udid: 7056B721-AFCA-465F-A65B-E301E21B6DDE; status: booted
Started device: {"token":"7056B721-AFCA-465F-A65B-E301E21B6DDE","name":"iPhone-11-Pro","status":"booted","type":"simulator","apiLevel":"13.5","platform":"ios","createDeviceOptions":{"type":"iPhone-11-Pro"},"pid":75610,"startedAt":1593415466101}
Default device: {
token: '7056B721-AFCA-465F-A65B-E301E21B6DDE',
name: 'iPhone-11-Pro',
status: 'booted',
type: 'simulator',
apiLevel: '13.5',
platform: 'ios',
createDeviceOptions: { type: 'iPhone-11-Pro' },
pid: 75610,
startedAt: 1593415466101
}
Trying to resolve automatically bundleId!
unzip -o /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa -d /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject
Setting capabilities sim.iPhone11Pro{ "bundleId" : "com.xxx.my-project" }!
Setting application name as my-project
Check and uninstall application from device.
Server args: ["-p","4723","--log-level","info"]
sample scenario
args.appiumCaps['wdaLocalPort']: 8410
Session info:
undefined
Appium settings:
Current version of appium doesn't support appium settings!
Could not resolve device density. Please provide offset in appium config
Appium driver has started successfully!
1) "before all" hook
2) "after all" hook
Killing simulator with udid 7056B721-AFCA-465F-A65B-E301E21B6DDE
Executing "/bin/ps aux | grep -ie '7056B721-AFCA-465F-A65B-E301E21B6DDE' | grep -v grep | xargs kill -9"
No matching processes to kill!
Stopping server...
Shut down!!!
About to exit with code: exit
unzip -o /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa -d /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject
Appium terminated due signal: null and code: 1
unzip -o /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject.ipa -d /Users/fleebzz/workspaces/xxx/my-project/platforms/ios/build/Debug-iphoneos/myproject
Application from device is uninstalled.
Application from device is uninstalled.
Exited from appium
0 passing (1m)
2 failing
1) sample scenario
"before all" hook:
TypeError: Cannot read property 'statBarHeight' of undefined
at Function.<anonymous> (node_modules/nativescript-dev-appium/lib/appium-driver.js:260:37)
at Generator.next (<anonymous>)
at fulfilled (node_modules/nativescript-dev-appium/lib/appium-driver.js:4:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
2) sample scenario
"after all" hook:
TypeError: Cannot read property 'quit' of undefined
at Context.<anonymous> (e2e/sample.e2e-spec.js:14:22)
at processImmediate (internal/timers.js:456:21)
at process.topLevelDomainCallback (domain.js:137:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! my-project#1.0.0 e2e: `node ./node_modules/nativescript-dev-appium/check-dev-deps.js && mocha --opts ./e2e/config/mocha.opts "--runType" "sim.iPhone11Pro" "--reuseDevice"`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the my-project#1.0.0 e2e script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/fleebzz/.npm/_logs/2020-06-29T07_24_52_063Z-debug.log
I tried to switch to an older version of iOS (12.X instead of 13.X)
I tried with an older version of appium and of nativescript-dev-appium
I tried with another iPhone version (iPhone X) instead of iPhone 11 Pro
Does anybody already have this issue or have any clue about how to resolve this ?
I made the necessary setups for react native on windows. Then I created my project with the command "npx react-native init projectname". Then I ran my project with "npx react-native run-android" command but I get the following errors.
C:\Users\user\OneDrive\Masaüstü\mobile\project>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\user\OneDrive\Masaüstü\mobile\project\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\user\OneDrive\Masaüstü\mobile\project\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\user\OneDrive\Masaustu\mobile\project\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 195
* What went wrong:
A problem occurred evaluating script.
> internal/modules/cjs/loader.js:969 throw err; ^Error: Cannot find module 'C:\Users\user\OneDrive\Masaüstü\mobile\project\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15) at Function.Module._load (internal/modules/cjs/loader.js:842:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []}
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\user\OneDrive\Masaüstü\mobile\project\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js, config]' command.
C:\Users\user\OneDrive\Masaüstü\mobile\project>
First, you have to install the latest version of #react-native-community/cli-platform-android
npm i #react-native-community/cli-platform-android
then go to the android directory and clean gradlew by the following command
cd android && gradlew clean
go back to your main directory and run app
cd.. && react-native run-android
I am running a build on Xcode for my React Native project and for some reason, when running the build in debug mode, this error appears:
'TransformError: [my directory] : Unknown plugin "module-resolver" ' inside my babelrc file.
I tried to npm install the module-resolver to see if that would get rid of the error however the simulator still has as red screen with that same TransformError.
Any help/guidance on this would be really helpful.
Thanks
You must install the 'babel-plugin-module-resolver'.
You should run:
npm install babel-plugin-module-resolver --save-dev
https://www.npmjs.com/package/babel-plugin-module-resolver
I’m on Xcode 8.3.3 with OS X 10.12.6
Fresh install of meteor 15.2.
Basically, i just created a basic app using meteor create
It prompted me to update to meteor 1.5.2 and I updated though it worked fine for meteor 1.4.3.
When I tried running meteor run ios after adding platforms for both the versions, it gave me the below error for 1.5.2
meteor run ios gives error.
=> App running at: http://localhost:3000/
=> Errors executing Cordova commands:
While running Cordova app for platform iOS with options --emulator:
Error: Command failed:
/Users/{$USER}/Development/webdev/simple-todos-react/.meteor/local/cordova-build/platforms/ios/cordova/run
--emulator TypeError: Cannot read property ‘replace’ of undefined at remove
(/Users/{$USER}/Development/webdev/simple-todos-react/.meteor/local/cordova-build/platforms/ios/cordova/node_modules/ios-sim/src/lib.js:282:70)
at Array.forEach (native) at Object.lib.getdevicetypes
(/Users/{$USER}/Development/webdev/simple-todos-react/.meteor/local/cordova-build/platforms/ios/cordova/node_modules/ios-sim/src/lib.js:292:22)
at Object.listEmulatorImages [as run]
(/Users/{$USER}/Development/webdev/simple-todos-react/.meteor/local/cordova-build/platforms/ios/cordova/lib/list-emulator-images:34:29)
at deployToSim
(/Users/{$USER}/Development/webdev/simple-todos-react/.meteor/local/cordova-build/platforms/ios/cordova/lib/run.js:173:50)
at
/Users/{$USER}/Development/webdev/simple-todos-react/.meteor/local/cordova-build/platforms/ios/cordova/lib/run.js:115:20
at _fulfilled
(/Users/{$USER}/Development/webdev/simple-todos-react/.meteor/local/cordova-build/platforms/ios/cordova/node_modules/q/q.js:834:54)
at self.promiseDispatch.done
(/Users/{$USER}/Development/webdev/simple-todos-react/.meteor/local/cordova-build/platforms/ios/cordova/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch
(/Users/{$USER}/Development/webdev/simple-todos-react/.meteor/local/cordova-build/platforms/ios/cordova/node_modules/q/q.js:796:13)
at
/Users/{$USER}/Development/webdev/simple-todos-react/.meteor/local/cordova-build/platforms/ios/cordova/node_modules/q/q.js:604:44
at ChildProcess.exitCallback (/tools/utils/processes.js:151:23) at
emitTwo (events.js:87:13) at ChildProcess.emit (events.js:172:7) at
Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
=> awaited here: at Function.Promise.await (/Users/{$USER}/.meteor/packages/templating-compiler/.1.3.2.qn524o++os+web.browser+web.cordova/plugin.compileTemplatesBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:35:12)
at CordovaProject.runCommands (/tools/cordova/project.js:715:22) at
CordovaProject.run$ (/tools/cordova/project.js:261:10) at tryCatch
(/Users/{$USER}/.meteor/packages/meteor-tool/.1.5.2.9i7mdi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/regenerator-runtime/runtime.js:63:40)
at GeneratorFunctionPrototype.invoke [as _invoke]
(/Users/{$USER}/.meteor/packages/meteor-tool/.1.5.2.9i7mdi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/regenerator-runtime/runtime.js:337:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next]
(/Users/{$USER}/.meteor/packages/meteor-tool/.1.5.2.9i7mdi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/regenerator-runtime/runtime.js:96:21)
at tryCatch
(/Users/{$USER}/.meteor/packages/meteor-tool/.1.5.2.9i7mdi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/regenerator-runtime/runtime.js:63:40)
at invoke
(/Users/{$USER}/.meteor/packages/meteor-tool/.1.5.2.9i7mdi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/regenerator-runtime/runtime.js:139:20) at
/Users/{$USER}/.meteor/packages/meteor-tool/.1.5.2.9i7mdi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/regenerator-runtime/runtime.js:184:11
at callInvokeWithMethodAndArg
(/Users/{$USER}/.meteor/packages/meteor-tool/.1.5.2.9i7mdi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/regenerator-runtime/runtime.js:183:16) at AsyncIterator.enqueue
(/Users/{$USER}/.meteor/packages/meteor-tool/.1.5.2.9i7mdi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/regenerator-runtime/runtime.js:206:13) at AsyncIterator.prototype.(anonymous function) [as next]
(/Users/{$USER}/.meteor/packages/meteor-tool/.1.5.2.9i7mdi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/regenerator-runtime/runtime.js:96:21)
at Object.runtime.async
(/Users/{$USER}/.meteor/packages/meteor-tool/.1.5.2.9i7mdi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/regenerator-runtime/runtime.js:226:14) at
/Users/{$USER}/.meteor/packages/templating-compiler/.1.3.2.qn524o++os+web.browser+web.cordova/plugin.compileTemplatesBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:32:39
/Users/{$USER}/.meteor/packages/templating-compiler/.1.3.2.qn524o++os+web.browser+web.cordova/plugin.compileTemplatesBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:190
throw error; ^ undefined
=> awaited here: at Function.Promise.await (/Users/{$USER}/.meteor/packages/templating-compiler/.1.3.2.qn524o++os+web.browser+web.cordova/plugin.compileTemplatesBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:35:12)
at /tools/cordova/runner.js:98:17 at
/tools/utils/buildmessage.js:271:13 at [object
Object]..extend.withValue (/tools/utils/fiber-helpers.js:89:14) at
/tools/utils/buildmessage.js:264:29 at [object
Object]..extend.withValue (/tools/utils/fiber-helpers.js:89:14) at
/tools/utils/buildmessage.js:262:18 at [object
Object]..extend.withValue (/tools/utils/fiber-helpers.js:89:14) at
/tools/utils/buildmessage.js:253:23 at [object
Object]..extend.withValue (/tools/utils/fiber-helpers.js:89:14) at
Object.capture (/tools/utils/buildmessage.js:252:19) at
CordovaRunner.startRunTargets (/tools/cordova/runner.js:97:37) at
[object Object]._.extend.runOnce (/tools/runners/run-app.js:772:21) at
[object Object]..extend._fiber (/tools/runners/run-app.js:885:28) at
/tools/runners/run-app.js:412:12
cat .meteor/local/cordova-build/platforms/ios/CordovaLib/VERSION gives
me 4.4.0
so the api is deprecated on iOS 9.0 api
what’s the proper way to update cordova to the latest version to work with iOS 10 (and potentially iOS 11 weeks later)?
This is (or was) a bug in the ios-sim package that Meteor uses to run the iOS Simulator. Until this dependency is updated in Meteor, you can work around the problem by manually updating ios-sim in your project folder, this should work:
cd .meteor/local/cordova-build/platforms/ios/cordova
meteor npm install ios-sim#latest
you can check out klaussner's answer here on github issueb below:
https://github.com/meteor/meteor/issues/9098