[英]Could not find module 'XXXX' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator in Swift Project?
This error has been stopping me progress with my project for a while now and nothing seems to be working for me.这个错误已经让我的项目停止了一段时间,似乎没有什么对我有用。
I have added A pod to my swift project but when I try to import it into my app, I get this error:我已将 A pod 添加到我的 swift 项目中,但是当我尝试将其导入我的应用程序时,我收到此错误:
Could not find module 'ImagePicker' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator
I've searched far and wide and tried almost all the solutions and still nothing seems to be working.我进行了广泛的搜索并尝试了几乎所有的解决方案,但似乎仍然没有任何效果。
I'm using the latest Xcode.我正在使用最新的 Xcode。
is there anything I need to do fix this as this is stopping me from building the app.我需要做些什么来解决这个问题,因为这会阻止我构建应用程序。
I have the same issue on the M1 laptop.我在 M1 笔记本电脑上遇到了同样的问题。 Have you tried this solution:您是否尝试过此解决方案:
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
Alternatively, you can change default scheme to Release, instead of Debug, by going to the top menu Product -> Scheme -> Edit Scheme
, select your Run scheme as Release.或者,您可以通过转到顶部菜单Product -> Scheme -> Edit Scheme
将默认方案更改为 Release,而不是 Debug,select 您的 Run scheme 为 Release。
However, better solution would be to simply make sure you're running Xcode using Rosetta.但是,更好的解决方案是简单地确保您使用 Rosetta 运行 Xcode。 Simple do the Get Info
on the Xcode icon, from there in popup window make sure that Open using Rosetta
is checked简单地在 Xcode 图标上Get Info
,然后在弹出窗口 window 中确保选中Open using Rosetta
I'm using SPM for dependency management and ran into issues with my M1 laptop.我正在使用 SPM 进行依赖管理,但我的 M1 笔记本电脑遇到了问题。 I had Excluded architectures within the top level project build settings set to arm64, which is where I ran into the problem我将顶级项目构建设置中的排除架构设置为 arm64,这是我遇到问题的地方
After I removed that it worked.在我删除它之后它起作用了。
Here's a screenshot of the Architectures section in the Project build settings, after making the change (ignore dark mode look, I was switching laptops).这是项目构建设置中架构部分的屏幕截图,在进行更改后(忽略暗模式外观,我正在切换笔记本电脑)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.