views:

738

answers:

3

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!

+1  A: 

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.

Jasarien
Thanks - that was it. :)
Where is this library? I found the one in the Platforms/iPhoneOS.platform directory and the error still occurs! :(
ing0
Usually in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/usr/lib/libsqlite3.dylib
Jasarien
+1  A: 

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'.

Jon Lidgard
A: 

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

Ross