NativeScript + Apple M1 Error: 'arch install' command failed

Viewed 333

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)
1 Answers

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