简体   繁体   English

找不到目标“x86_64-apple-ios-simulator”的模块“XXXX”; 在 Swift 项目中找到:arm64、arm64-apple-ios-simulator?

[英]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.

相关问题 找不到目标“x86_64-apple-ios-simulator”的模块“FBSDKCoreKit”; 找到:arm64,arm64-apple-ios-simulator - Could not find module 'FBSDKCoreKit' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator Xcode 12 问题 - 找不到目标“arm64-apple-ios-simulator”的模块“FrameworkName”; 找到:x86_64-apple-ios-simulator,x86_64 - Xcode 12 issue - Could not find module 'FrameworkName' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64 找不到目标“arm64-apple-ios-simulator”的模块“Alamofire”; 找到:x86_64-apple-ios-simulator,x86_64 - could not find module 'Alamofire' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64 找不到目标“x86_64-apple-ios-simulator”的模块“MyCustomFramework”; 找到:arm64、armv7-apple-ios、arm64-apple-ios、arm、armv7 - Could not find module 'MyCustomFramework' for target 'x86_64-apple-ios-simulator'; found: arm64, armv7-apple-ios, arm64-apple-ios, arm, armv7 找不到目标“x86_64-apple-ios-simulator”的模块“Alamofire” - could not find module 'Alamofire' for target 'x86_64-apple-ios-simulator' 找不到目标“x86_64-apple-ios-simulator”的模块“Kingfisher” - Could not find module 'Kingfisher' for target 'x86_64-apple-ios-simulator' 找不到目标“x86_64-apple-ios-simulator”的模块 - Could not find module for target 'x86_64-apple-ios-simulator' 目标 'arm64-apple-ios' 的 iOS 'Heimdall' 出现错误; 找到:x86_64“ - Getting Error in iOS 'Heimdall' for target 'arm64-apple-ios'; found: x86_64 " 无法使用 Apple Silicon 上的 iOS 模拟器 lipo arm64.a 文件的 iOS 设备 - Cannot lipo arm64 .a files of iOS device with iOS simulator on Apple Silicon “'Razorpay' 是为不兼容的目标 arm64-apple-ios10.0 创建的”,同时为 flutter iOS 模拟器构建 - "'Razorpay' was created for incompatible target arm64-apple-ios10.0" while building for flutter iOS simulator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM