简体   繁体   中英

Xcode 12 - No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=arm64e armv7s arm64 arm7)

Since I update Xcode to Xcode 12, I've got this error when I build:

Check dependencies
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=arm64e armv7s arm64 arm7)

I try a lot of things:

  • Uninstall/reinstall Pods via pod install
  • Build Active Architecture Only to No or to Yes for Debug and Release
  • Same thing for Pods project

Don't know what to do. This error come when I want to launch on iOS 14, but in iOS 13.7 this work perfectly without change.

-- EDIT --

I solve my problem by adding arm64 arm64e armv7 armv7s x86_64 to VALID_ARCHS , both in 'MyProject' and 'MyProjectTest', and it work now.

If you can't see "VALID_ARCHS" in BuildSettings. You can click the plus button.

在此处输入图片说明

click "Add User-Defined Setting"

在此处输入图片说明

Input setting name "VALID_ARCHS" , input value "arm64 arm64e armv7 armv7s x86_64"

在此处输入图片说明 在此处输入图片说明

Theorectically it should be enough changing debug from yes to no.

在此处输入图片说明

But as you said it did not work it must be that you have to set VALID_ARCHS to what you have plus x86_64 .

Go to your App's target and select 64 bit standard architectures in Architectures section. See attached screenshot

在此处输入图片说明

在 rosetta 中运行 Xcode(通过转到 .app 文件并单击“获取信息”,然后单击“在 rosetta 下运行”

M1 Mac:在 rosetta 中运行 Xcode(通过转到 .app 文件并单击“获取信息”,然后单击“使用 rosetta 打开”

在 Xcode 12、M1 芯片 macbook 中,我只需要在真实设备中运行应用程序就可以了

With Mac M1: Right click into xcode => Get Info => Open using Rosetta在此处输入图像描述 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM