missing required architecture i386 解决方法

来源:互联网 发布:caffe demo github 编辑:程序博客网 时间:2024/04/29 01:06
missing required architecture i386 解决方法 
可能原因一:项目内保存了.framework文件,在复制分发到不同计算机的时候可能会引发该错误 
解决方法一:
来到Targets->Build Settings->Framework Search Paths,将其内容删除。让xcode不管项目目录下的.framework文件,而是去包含本机的。当然你也可以手动删除它们。 
解决方法二:
这个是在stack overflow上看到的: 
I had this same problem, and the solution turned out to be an easy fix. Backup then open project.pbxproj (located inside your project file bundle) in TextMate or TextEdit and search for the section titled "/* Begin XCBuildConfiguration section */". Look for a key named FRAMEWORK_SEARCH_PATHS and delete it and it's contents (once per build configuration, so I removed it in two places). 

用文本编辑器打开位于项目包内的project.pbxproj,找到并删除FRAMEWORK_SEARCH_PATHS键值。跟方法一差不多。 

解决方法三:
删除Library Search Paths的内容,这个可能性比较小吧,莫非是sdk库被存到项目目录下了? 
可能原因二:正如这个错误提示所指出的那样,缺少了i386架构的东西。这很可能是由于项目中包含的静态库是被编译用于真机测试的,大家都知道苹果手机cpu是arm架构,而mac笔记本(当然也包括运行于其上的iphone-simulator)是intel架构。所以当这个静态库被编译用于device的时候,在目标为simulator下的编译是会报错的。 
解决方法一:
直接真机调试。 
解决方法二:
重新为simulator编译静态库,然后有一个更高端的解决办法,就是将两种架构的静态库合并: 
0 0