ChatGPT解决这个技术问题 Extra ChatGPT

What does warning "Mapping architecture arm64 to x86_64" mean?

After migrating my framework to Xcode 10 beta (10L176w) I started to get warnings like:

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.

... 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.

Despite these warnings the build and the unit tests all pass Ok. I'm using Swift 4.2.

Still, what are these warnings about?

I am seeing this when setting when trying to build 64 bit only using ARCHS = $(ARCHS_STANDARD_64_BIT) and VALID_ARCHS = $(inherited) x86_64 i386

H
Hassan Taleb

Go to Build Settings and do as shown below

https://i.stack.imgur.com/3X9MM.png


I confirm, this worked for me - I don't know why, but those settings were highlighted in bold both on project and target build settings. Then I deleted as mentioned above (in both places!), and this just removed bold highlight (reverted to defaults, obviously), and the warnings are gone
Just to clarify, this must be done on both the project and target.
Nice answer, I propose for this to be the solution.
When I deleted it, nothing shows up in Resolved and I get There are no valid architectures to compile for because the VALID_ARCHS build setting is an empty list
seems to not work any longer. I'm getting the same problem Crystal is reporting with Xcode 11 beta 6. @John's answer works for me instead
P
Paulo Mattos

I was able to silence these warnings by changing my Valid Architectures setting to $(ARCHS_STANDARD) which matches my Architectures setting as well.

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.


This setting worked for me for a "universal" framework targeting both iOS and macOS.
That was my solution. I set valid architectures: $(ARCHS_STANDARD) in Project and in Targets. Thanks.
@CGN how u have set in Project ? i set successfully for Targets.
@Erum: see 2 screenshots below
R
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.


I also see this error. I have not overridden the settings VALID_ARCHS. It contains arm64 for both debug and release.
This appears to be a bug in Xcode 10. Still occurs with default settings
This but still seems to appear with the release version of Xcode 10. Anyone have any update on this?
me2, i was just googling about this, but to no avail
I needed to go to all my sub projects and targets and delete VALID_ARCHS to set it to default and then clean and close / open Xcode again for it to work fully for me
Q
Quanhua Guan

For the TARGET which report warnings, Change the "Valid Architecture" setting to:

$(VALID_ARCHS)
x86_64

https://i.stack.imgur.com/D5JvK.png


Best answer for sure!
j
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").


S
ScottM

I am also facing the same problem. For resolution, I have just changed the build system from Standard to Legacy and that resolved the issue.


D
Dharman

The solution is simpler: in Valid Architectures just replace arm64 with x86_64.

https://i.stack.imgur.com/287iN.png

https://i.stack.imgur.com/qG2Se.png

Replacing:

armv7 with i386,

armv7s with i386,

and, arm64 with x86_64

(as mentioned in the Warnings) was my solution. The result in the Valid Architecture setting was:

https://i.stack.imgur.com/vpQF2.png

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/

I think the formulation of this warning in Xcode is a bit confusion.


D
Deepak Ror

If you are facing problem in Flutter:

Delete the Podfile, Podfile.lock, Pods folder, Runner.xcworkspace, Flutter.framework. Run flutter clean. Run flutter build ios.


j
joelliusp

https://i.stack.imgur.com/yByk4.png


on the current Xcode it does not exist this option anymore.
@lambdapool which option are you not seeing? Is it "Valid Architectures" / "VALID_ARCHS"?
J
Jonathan

I found the easiest way to resolve this was to open the project in my text editor, then find and delete all VALID_ARCHS lines.


g
grape100

I have seen the same warning as I building my framework. After a while noticed these valid architecture values vary depending on the type of devices regardless the values in build settings.

Real devices-> arm64 
Simulator devices ->x86-64

B
BoP

Go to Target > Build Settings > Architectures >Excluded Architectures (x84_64) .. It is used to Run a Real device And Use (arm64) to Run a Simulator For (Any SDK).

If selected Excluded Architectures > Debug and Release

https://i.stack.imgur.com/BPcrM.png

https://i.stack.imgur.com/HxuFm.png

To solve this problem virtually and radically, you have to choose ( Any IOS Simulator SDK) instead of (Any SDK) and set value (arm64) In this case, you can make a build and a run together without having to change the values each time.

https://i.stack.imgur.com/k10Mf.png


B
Brody

if your [build Settings] is armv7 armv7s arm64, please delete armv7s. the warning will be cancelled.


it is not just about armv7, it's a general issue and your suggestion is not forward looking