You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ionic apps fail to build for simulator in Xcode on Macs using Apples new m-Series CPUs if its incorporating (@capacitor-mlkit/barcode-scanning). (Only tested with macOS Sonoma and Xcode 15)
After implementing the barcode scanner plugin (@capacitor-mlkit/barcode-scanning) and running npx cap sync, the Build Setting Excluded Architectures in Xcode is set to arm64 for Any iOS Simulator SDK automatically (see Screenshot).
Since newer Macs are running on this architecture and also try to build for an arm64 simulator, the build process fails, providing this error message: /Users/timmoritzkuehle/Sirum Code/SirumApp_cap5/Code/ios/App/App/AppDelegate.swift:2:8 Could not find module 'Capacitor' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: /Users/timmoritzkuehle/Library/Developer/Xcode/DerivedData/App-ednjbqvwcfwlcbgrebswvcdqcmqf/Build/Products/Debug-iphonesimulator/Capacitor/Capacitor.framework/Modules/Capacitor.swiftmodule
By turning the build setting Build For Active Architecture Only you get two different error messages: Framework 'Pods_App' not found and Linker command failed with exit code 1 (use -v to see invocation)
Currently the only workaround is to run a simulator using apples Rosetta translation layer. This harms performance and introduces a whole new layer potential system related build errors.
Expected behavior
It would be great if barcode scanning would support arm64 architectures natively.
Open it in Xcode, start the Simulator and see the build succeed
Implement (@capacitor-mlkit/barcode-scanning)
Sync new modules npx cap sync
Open the app in Xcode again
Notice the new setting for Excluded Architectures mentioned above
Try to run the simulator again and see the build fail
Other information
@AntonGrafton reported this problem in #85. However, it seems that the discussion on that one never got down to the point, where the system architecture was discovered to be causing the issue.
Google has a guide on migrating their MLKit pods for iOS to arm64 Systems. You can find it here. Sadly my pitiful knowledge about capacitor plugin development won't even suffice to tell if this is helpful or not. Sorry for that. 😅
First of all: You can definitely use this project with an M1 Mac and without Rosetta.
Have you tried the fix I mentioned in #85 (comment)? I can't find it in your reproduction.
Google has a guide on migrating their MLKit pods for iOS to arm64 Systems.
We already use the up-to-date ML Kit iOS cocoapods, see:
Have you tried the fix I mentioned in #85 (comment)? I can't find it in your reproduction.
This works. Sorry for the oversight! I misread the comment and thought this would fix builds on physical devices only.
Just out of curiosity: Do you know why adding these lines to the Podfile does something different than setting Build For Active Architecture Only to No in Xcode? 🤔
We already use the up-to-date ML Kit iOS cocoapods, see:
Sorry, my knowledge in native capacitor plugin development is so sparse that I couldn't even tell, if the link would be of any help. Just stumbled upon during my research.
PS: Please don't get me wrong. I wanted to be precise and helpful in my PR. Sorry, if I came across a little rude in trying do so so. I really didn't mean to!
Just out of curiosity: Do you know why adding these lines to the Podfile does something different than setting Build For Active Architecture Only to No in Xcode? 🤔
You can also do this via XCode, but you have probably configured the App Project and not the Pod Project. This configuration is required by the pods. The code in the pod file ensures that this configuration is restored after each pod installation.
Sorry, my knowledge in native capacitor plugin development is so sparse that I couldn't even tell, if the link would be of any help. Just stumbled upon during my research.
No problem at all! I appreciate any interest in my projects. I am closing this issue. Let me know if you have any other questions.
Plugin(s)
Did you test the latest version?
Platform(s)
Current behavior
Ionic apps fail to build for simulator in Xcode on Macs using Apples new m-Series CPUs if its incorporating (@capacitor-mlkit/barcode-scanning). (Only tested with macOS Sonoma and Xcode 15)
After implementing the barcode scanner plugin (@capacitor-mlkit/barcode-scanning) and running
npx cap sync
, the Build Setting Excluded Architectures in Xcode is set to arm64 for Any iOS Simulator SDK automatically (see Screenshot).Since newer Macs are running on this architecture and also try to build for an arm64 simulator, the build process fails, providing this error message:
/Users/timmoritzkuehle/Sirum Code/SirumApp_cap5/Code/ios/App/App/AppDelegate.swift:2:8 Could not find module 'Capacitor' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: /Users/timmoritzkuehle/Library/Developer/Xcode/DerivedData/App-ednjbqvwcfwlcbgrebswvcdqcmqf/Build/Products/Debug-iphonesimulator/Capacitor/Capacitor.framework/Modules/Capacitor.swiftmodule
By turning the build setting Build For Active Architecture Only you get two different error messages:
Framework 'Pods_App' not found
andLinker command failed with exit code 1 (use -v to see invocation)
Currently the only workaround is to run a simulator using apples Rosetta translation layer. This harms performance and introduces a whole new layer potential system related build errors.
Expected behavior
It would be great if barcode scanning would support arm64 architectures natively.
Reproduction
https://github.com/timmkuehle/capacitor-mlkit-barcode-scanning-test
Steps to reproduce
On a Mac with an m-Series CPU:
ìonic start
npx cap sync
Other information
@AntonGrafton reported this problem in #85. However, it seems that the discussion on that one never got down to the point, where the system architecture was discovered to be causing the issue.
Google has a guide on migrating their MLKit pods for iOS to arm64 Systems. You can find it here. Sadly my pitiful knowledge about capacitor plugin development won't even suffice to tell if this is helpful or not. Sorry for that. 😅
Capacitor doctor
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 5.5.1
@capacitor/core: 5.5.1
@capacitor/android: 5.5.1
@capacitor/ios: 5.5.1
Installed Dependencies:
@capacitor/cli: 5.5.1
@capacitor/core: 5.5.1
@capacitor/android: 5.5.1
@capacitor/ios: 5.5.1
[success] iOS looking great! 👌
[success] Android looking great! 👌
Before submitting
The text was updated successfully, but these errors were encountered: