ios 警告“将架构 arm64 映射到 x86_64”是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50768723/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does warning "Mapping architecture arm64 to x86_64" mean?
提问by courteouselk
After migrating my framework to Xcode 10 beta (10L176w) I started to get warnings like:
将我的框架迁移到 Xcode 10 beta (10L176w) 后,我开始收到如下警告:
Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform.
将架构 arm64 映射到 x86_64。确保为 iOS Simulator 平台正确配置了此目标的架构和有效架构构建设置。
... and:
... 和:
Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform.
将架构 armv7 映射到 i386。确保为 iOS Simulator 平台正确配置了此目标的架构和有效架构构建设置。
Despite these warnings the build and the unit tests all pass Ok. I'm using Swift 4.2.
尽管有这些警告,构建和单元测试都通过了 Ok。我正在使用 Swift 4.2。
Still, what are these warnings about?
不过,这些警告是关于什么的?
回答by John Montgomery
I was able to silence these warnings by changing my Valid Architecturessetting to $(ARCHS_STANDARD)
which matches my Architecturessetting as well.
通过将我的Valid Architectures设置更改为$(ARCHS_STANDARD)
与我的Architectures设置相匹配,我能够消除这些警告。
Oddly, this displayed as armv7 arm64
(in comparison to the default setting of armv7 armv7s arm64
), but setting it to that value manually still caused the warnings. Not sure what the significance of that is, but I haven't noticed any problems in my testing yet.
奇怪的是,这显示为armv7 arm64
(与 的默认设置相比armv7 armv7s arm64
),但手动将其设置为该值仍然会导致警告。不确定这有什么意义,但我在测试中还没有发现任何问题。
回答by Rick Ballard
You likely have the VALID_ARCHS ("Valid Architectures") build setting overridden, either for the target or for its project. This is a build setting that should get its value automatically based on which run destination you're building for. When you figure out where this override is coming from (the build setting will display in bold when overridden), select it and hit the delete key to restore it to the default value.
您可能为目标或其项目覆盖了 VALID_ARCHS(“有效架构”)构建设置。这是一个构建设置,它应该根据您正在构建的运行目标自动获取其值。当您确定此覆盖的来源时(覆盖时构建设置将以粗体显示),选择它并按删除键将其恢复为默认值。
回答by Quanhua Guan
回答by jldailey
Similar to other answers, I was able to remove the warning by changing $(VALID_ARCHS)
(Valid Architectures) to $(ARCHS_STANDARD)
. From there, I cleared all Derived Data and restarted Xcode 10.0. This made the warning go away completely. Deleting everything from Valid Architectures just made a different warning appear ("No valid architectures found").
与其他答案类似,我能够通过将$(VALID_ARCHS)
(Valid Architectures)更改为$(ARCHS_STANDARD)
. 从那里,我清除了所有派生数据并重新启动了 Xcode 10.0。这使得警告完全消失。从有效架构中删除所有内容只会出现不同的警告(“找不到有效的架构”)。
回答by CGN
The solution is simpler: in Valid Architectures just replace arm64 with x86_64.
解决方案更简单:在 Valid Architectures 中只需将 arm64 替换为 x86_64。
Had similar issue and the following three warnings in my project:
My Valid Archtecturesoriginally were
Replacing:
更换:
- armv7 with i386,
- armv7s with i386,
- and, arm64 with x86_64
- 带有 i386 的 armv7,
- 带有 i386 的 armv7s,
- 和,arm64 和 x86_64
(as mentioned in the Warnings) was my solution. The result in the Valid Architecturesetting was:
(如警告中所述)是我的解决方案。在结果有效的架构设置是:
After the replacements my three warnings above disappeared.
更换后,我上面的三个警告消失了。
More profound info about the Architectures can be found here: https://docs.elementscompiler.com/Platforms/Cocoa/CpuArchitectures/
更多关于架构的深刻信息可以在这里找到:https: //docs.elementscompiler.com/Platforms/Cocoa/CpuArchitectures/
I think the formulation of this warning in Xcode is a bit confusion.
我认为 Xcode 中这个警告的表述有点混乱。
回答by Deepak Kanyan
If you are facing problem in Flutter:
如果您在 Flutter 中遇到问题:
- Delete the Podfile, Podfile.lock, Pods folder, Runner.xcworkspace.
- Run
flutter clean
. - Run
flutter build ios
.
- 删除 Podfile、Podfile.lock、Pods 文件夹、Runner.xcworkspace。
- 运行
flutter clean
。 - 运行
flutter build ios
。
回答by joelliusp
I was seeing this warning when I tried to compile code for both iOS and Mac OS.
I was able to get around it by first doing what Hassan Taleb suggested in his answer: clear out the architectures so that only valid iPhone architectures are in there. And then finally, to maintain being able to build for Mac OS, wave your mouse over the Valid Architectures so that a plus button appears. Click that and then you can add separate settings for different platforms as needed, including different CPU architectures. For macOS SDK, I can set my Valid Architectures to just x86_64 if I want.
当我尝试为 iOS 和 Mac OS 编译代码时,我看到了这个警告。我能够通过首先按照 Hassan Taleb 在他的回答中建议的方法来解决它:清除架构,以便只有有效的 iPhone 架构在那里。最后,为了保持能够为 Mac OS 构建,将鼠标悬停在 Valid Architectures 上,这样一个加号按钮就会出现。单击它,然后您可以根据需要为不同的平台添加单独的设置,包括不同的 CPU 架构。对于 macOS SDK,如果需要,我可以将我的有效架构设置为 x86_64。
回答by wilson wang
if your [build Settings] is armv7 armv7s arm64, please delete armv7s. the warning will be cancelled.
如果你的【构建设置】是 armv7 armv7s arm64,请删除 armv7s。警告将被取消。