Reputation: 2784
@ionic/angular: 6.0.1 & cordova-ios: 6.2.0
Hey there,
I just got my new M1 Macbook Pro setup and I'm trying to run the command
ionic cordova build ios
It's failing with
building for iOS Simulator, but linking in object file built for iOS, file 'FILE_PATH' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
...
** BUILD FAILED **
I googled this and everything I'm finding online says
Basically you have to exclude arm64 for simulator architecture both from your project and the Pod project,
and provide tutorials on how to do this via XCode example
When I look in XCode, I don't see a section for "Excluded Architectures". Even if I did see this, my build flow removes & adds back the ios platform so I would have to do this every time...
Then I see people are saying add a post_install script to PodFiles. When using Cordova/Ionic how would I add a post_install script for the PodFile?
If I plug my phone into the computer during the build, it works but this is not an ideal solution as I want it to be able to build a bunch of white-labeled apps without having my phone required to be plugged into my computer during this process.
Anybody have any solutions for this / information?
Update: I got the builds to complete successfully using a terminal opening with Rosetta. Steps to reproduce:
Everything seems to be working now... I'm sure this isn't the "ideal" solution, but it works for now
Duplicate terminal
Upvotes: 2
Views: 15127
Reputation: 51
For me, nothing worked except Rosetta.
Steps that worked for me:
softwareupdate --install-rosetta
Right click xcode, check open with rosetta and then Open XCode.
Cmd+Shift+K -> Run Build
It will open the app in simulator/device
Upvotes: 4