ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️

Home Page:https://capacitorjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Build failed because Capacitor.swiftmodule is missing a required architecture. Would you like to build for rosetta instead?

VerburgtJimmy opened this issue · comments

Capacitor Version

Latest Dependencies:
@capacitor/cli: 6.0.0
@capacitor/core: 6.0.0
@capacitor/android: 6.0.0
@capacitor/ios: 6.0.0

Installed Dependencies:
@capacitor/cli: 6.0.0
@capacitor/core: 6.0.0
@capacitor/android: 6.0.0
@capacitor/ios: 6.0.0

Other API Details

npm version: 10.7.0

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

After I upgraded my ionic application to V8 and my capacitor version to V6 I can't build my app on ios. I am getting the following message as a popup when building the app with 'ionic cap build ios' and then running it in xcode 15: Build failed because Capacitor.swiftmodule is missing a required architecture. Would you like to build for rosetta instead?
And in the output of xcode it gives this error: Could not find module 'capacitor; for target 'x86_64-apple-ios-simulator' found: arm64-apple-ios-simulator.

Now if I run it on a rosetta simulator it works but that of course is not what I want. I want to be sure it runs good natively.

Expected Behavior

That when i run the new build i don't get the error displayed above.

Project Reproduction

No link

Additional Information

My simulator is a Iphone 15 on ios 17.4

same issue

This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed.
Please see the Contributing Guide for how to create a Sample App.
Thanks! Ionitron 💙

same issue

same isssue

I will try to create a new repo with a new project to check if the issue is with my current project. I have updated this project from ionic v7 to 8 and capacitor v5 to v6 and after that i got this error so if the issue is consistent with v6 it should happen in a new v6 project with ionic. If not it is a problem in the upgrade from v5 to v6.

Just checked and a new ionic project using capacitor v6 doesn't have this error. I will now try to compare the different package version from my own project and the new test project to see if the issue lies there

Just checked and debugged my npm packages and it appears this error comes when i add the @capacitor-mlkit/barcode-scanning package. Therefore I have closed this issue and i have made a new issue at that package. See this capawesome-team/capacitor-mlkit#153

for reproduction look at the reproduction steps in the new issue.