ios 升级到 xcode 4 错误没有要编译的架构
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4915953/
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
Upgrading to xcode 4 error No architectures to compile for
提问by James
I am getting an error after upgrading to xcode 4, for all of the library projects that my application depends on.
对于我的应用程序依赖的所有库项目,升级到 xcode 4 后出现错误。
[BEROR]No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=i386, VALID_ARCHS=armv6).
[BEROR]没有要编译的架构(ONLY_ACTIVE_ARCH=YES,active arch=i386,VALID_ARCHS=armv6)。
回答by James
It looks like all you have to do is add i386 to the Valid Architectures in the build settings. I was compiling for the simulator, and that's why it was complaining.
看起来您所要做的就是将 i386 添加到构建设置中的 Valid Architectures 中。我正在为模拟器编译,这就是它抱怨的原因。
This seems odd, because the project worked just fine before upgrade. It looks to me like you have to do this for any project you upgrade. At least that will work for now.
这看起来很奇怪,因为该项目在升级前运行良好。在我看来,您必须为升级的任何项目执行此操作。至少现在会起作用。
回答by Jano
See https://devforums.apple.com/message/376732#376732
见https://devforums.apple.com/message/376732#376732
"No architectures to compile for" means "Valid Architectures" field is empty. Update it to
$(ARCHS_STANDARD_32_BIT)
and you'll see the usual armv6 armv7. This happens sometimes in XCode 4 GM after updating "Base SDK" to "Latest SDK".
“没有要编译的架构”意味着“有效架构”字段为空。将其更新为
$(ARCHS_STANDARD_32_BIT)
,您将看到通常的 armv6 armv7。在将“Base SDK”更新为“Latest SDK”后,有时会在 XCode 4 GM 中发生这种情况。
回答by samwize
Open project.pbxproj (show package content of xcodeproj file), remove all lines with VALID_ARCHS = "...";
, and restart Xcode.
打开 project.pbxproj(显示 xcodeproj 文件的包内容),删除所有带有 的行VALID_ARCHS = "...";
,然后重新启动 Xcode。
回答by Joe D'Andrea
Very strange. I encountered the same error and both the Debug and Release "Valid Architectures" were set to armv6 and armv7. (The same code compiles fine in Xcode 3.2.) I ended up deleting both settings, then expressly setting them to $(ARCHS_STANDARD_32_BIT) ... which in turn translates to armv6 and armv7 again ... and it compiles just fine now. No i386 needed. Hmm ...
很奇怪。我遇到了同样的错误,调试和发布“有效架构”都设置为 armv6 和 armv7。(相同的代码在 Xcode 3.2 中编译得很好。)我最终删除了这两个设置,然后明确地将它们设置为 $(ARCHS_STANDARD_32_BIT) ......这反过来又转换为 armv6 和 armv7 ......现在它编译得很好。不需要 i386。唔 ...
回答by speznaz
If this error occures in combination with Phonegap the solution is:
如果此错误与 Phonegap 结合出现,则解决方案是:
Add "i386" in the build settings to the "Valid Architectures": for your project and the library (PhoneGapLib.xcodeProj). In both cases for the project and the target.
将构建设置中的“i386”添加到“有效架构”:对于您的项目和库 (PhoneGapLib.xcodeProj)。在项目和目标的两种情况下。
回答by serenn
I was getting this error when I was trying to convert to automatic reference counting in the latest Xcode. I fixed it by adding "x86_64" to the valid architecture list, which allowed me to continue building.
当我尝试在最新的 Xcode 中转换为自动引用计数时遇到此错误。我通过将“x86_64”添加到有效架构列表中来修复它,这使我能够继续构建。
Just in case someone else was having the same issue, thought I'd throw in what worked for me!
以防万一其他人遇到同样的问题,我想我会投入对我有用的东西!
回答by becker
Had similar issues with xcode6 it seems to pop when upgrading xcode, tried all of what is suggested with no success what worked for me was in the new xcode created a simple new app(tabbed) and made sure my App had the same settings for architectures
与 xcode6 有类似问题,升级 xcode 时似乎会弹出,尝试了所有建议但没有成功对我有用的是在新 xcode 中创建了一个简单的新应用程序(标签式)并确保我的应用程序具有相同的架构设置
回答by dreadbot
Open a new project and compile in Xcode 4 and then compare build settings with converted project. That's how I found it.
打开一个新项目并在 Xcode 4 中编译,然后将构建设置与转换后的项目进行比较。我就是这样找到的。