I'm writing an iPhone app which seems to run fine on the simulator, however when I try and run it on the device I get a libsqlite3.dylib, file is not of the required architecture error. I'm using os 3.0 on a 3GS. Any ideas on what could be causing this?
我正在编写一个似乎在模拟器上运行良好的iPhone应用程序,但是当我尝试在设备上运行它时,我得到一个libsqlite3.dylib,文件不是所需的体系结构错误。我在3GS上使用os 3.0。关于可能导致这种情况的任何想法?
Thanks!
3 个解决方案
#1
When you added the SQLite library to your project, it sounds like you chose the one from the iPhoneSimulator sdk. You need to choose the one in the iPhoneOS sdk for whichever version you're building for.
当您将SQLite库添加到项目中时,听起来就像是从iPhoneSimulator sdk中选择了一个。您需要在iPhoneOS sdk中选择一个版本,以便为您构建的版本。
#2
If you still get the error make sure you haven't accidentally copied the simulator version of the lib into your own project directory. You need to delete it if you have. This would have occurred because you accidentally selected 'Copy items into destination groups folder' when you added the lib to your project. Also make sure reference type is 'Relative to Current SDK'.
如果仍然出现错误,请确保您没有意外地将lib的模拟器版本复制到您自己的项目目录中。如果有,你需要删除它。这可能是因为您在将lib添加到项目时意外选择了“将项目复制到目标组文件夹”。还要确保引用类型为“相对于当前SDK”。
#3
I had a similar issue which caused by the search paths for the linked library pointing to incompatible files.
我有一个类似的问题,由链接库的搜索路径指向不兼容的文件。
I wrote a blog post on how to fix it here:
我在这里写了一篇关于如何修复它的博客文章:
Fixing the "missing required architecture arm in file" error when developing for iPad
在为iPad开发时修复“缺少必需的架构文件臂”错误
#1
When you added the SQLite library to your project, it sounds like you chose the one from the iPhoneSimulator sdk. You need to choose the one in the iPhoneOS sdk for whichever version you're building for.
当您将SQLite库添加到项目中时,听起来就像是从iPhoneSimulator sdk中选择了一个。您需要在iPhoneOS sdk中选择一个版本,以便为您构建的版本。
#2
If you still get the error make sure you haven't accidentally copied the simulator version of the lib into your own project directory. You need to delete it if you have. This would have occurred because you accidentally selected 'Copy items into destination groups folder' when you added the lib to your project. Also make sure reference type is 'Relative to Current SDK'.
如果仍然出现错误,请确保您没有意外地将lib的模拟器版本复制到您自己的项目目录中。如果有,你需要删除它。这可能是因为您在将lib添加到项目时意外选择了“将项目复制到目标组文件夹”。还要确保引用类型为“相对于当前SDK”。
#3
I had a similar issue which caused by the search paths for the linked library pointing to incompatible files.
我有一个类似的问题,由链接库的搜索路径指向不兼容的文件。
I wrote a blog post on how to fix it here:
我在这里写了一篇关于如何修复它的博客文章:
Fixing the "missing required architecture arm in file" error when developing for iPad
在为iPad开发时修复“缺少必需的架构文件臂”错误