ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
11.31k stars 962 forks source link

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

Closed VerburgtJimmy closed 2 weeks ago

VerburgtJimmy commented 3 weeks ago

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

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

scr2em commented 3 weeks ago

same issue

ionitron-bot[bot] commented 3 weeks ago

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 💙

iHackFX commented 2 weeks ago

same issue

betocantu93 commented 2 weeks ago

same isssue

VerburgtJimmy commented 2 weeks ago

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.

VerburgtJimmy commented 2 weeks ago

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

VerburgtJimmy commented 2 weeks ago

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 https://github.com/capawesome-team/capacitor-mlkit/issues/153

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