iPhone 警告 libsqlite3.dylib 不符合所需架构?
我正在编写一个 iPhone 应用程序,它似乎在模拟器上运行良好,但是当我尝试在设备上运行它时,我收到一个 libsqlite3.dylib, file is not of the required Architecture 错误。 我在 3GS 上使用 os 3.0。 关于可能导致这种情况的原因有什么想法吗?
谢谢!
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?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您将 SQLite 库添加到项目中时,听起来好像您选择了 iPhoneSimulator sdk 中的一个。 无论您要构建哪个版本,您都需要在 iPhoneOS sdk 中选择一个。
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.
如果仍然出现错误,请确保您没有意外地将模拟器版本的 lib 复制到您自己的项目目录中。 如果有的话需要删除它。 发生这种情况的原因是,当您将库添加到项目时,您意外选择了“将项目复制到目标组文件夹”。 另请确保引用类型为“相对于当前 SDK”。
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'.
我遇到了类似的问题,这是由指向不兼容文件的链接库的搜索路径引起的。
我在这里写了一篇关于如何修复它的博客文章:
修复了针对 iPad 进行开发时出现的“文件中缺少所需的架构臂”错误
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