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!
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.
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'.
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
Related
Fresh cocos2d-x project build using Xcode runs normally on iOS simulator/device, but after making changes to cpp source files, rebuild fails with error-
Xcode cannor run using selected device. Choose a destination with a supported architecture in order to run on this device.
The only way to make it work is delete build binaries (i.e. delete XCode>Derived Data folder), and take fresh build after restarting Xcode.
Can someone please help me resolve this issue?
Additional Details:
This error is related to mismatching device architecture and armv6 armv7 flags. But first build works fine, and stops working after second build onwards, that means this is not a possible issue.
If the project is not using cocos2d-x (i.e. plain Objective-C project), then there is no such error after second build.
Compiler selected: Apple LLVM Compiler 4.2
Thanks in advance!
Following my comment you should make sure you use the latest templates for creating cocos2d projects. Some templates will only work for a specific Xcode version so make sure you use the right templates for your xcode version (There are some for xcode 3.x and others for xcode 4.x)
Change Valid architecture to armv7 and armv7s. Remove armv6. See image for more information.
So I have a brand new app I created last night for iOS6, using XCode 4.5. I can properly develop on my iPhone 4 with iOS6.
Today I got my new iPhone 5 with iOS6 and, after updating the certificates with the new device UUID, I tried to run my app on it and got this error:
XCode cannot run using the selected device. Choose a destination with
a supported architecture in order to run on this device.
I've enabled the device for development. Both armv7 and armv7s are on the settings.
I have included the sources from the Facebook 3.0 SDK and the linker flag '-lsqlite3.0'. I'm guessing the issue has to be related, but cannot figure what is wrong.
Any ideas how to solve it?
PS: The issue happens too when running the app on the simulator. No idea what changed on my project or XCode between last night and today, other than I have a new device and new certificates.
The selected destination does not support the architecture for which the selected software is built. Switch to a destination that supports that architecture in order to run the selected software.
Also you need to select the compiler LLVM in
Project --> Build Settings --> Build Options
I have found the same issue while running an OLD project on XCode 5.0 and My solution is:
You need to do following steps for getting out with this:
1. Set Valid Architectures : armv7,armv7s
2. Set compiler as LLVM in Project ---> Build Settings ---> Build Options.
3. Set Base and Deployment sdk properly.
This is my solution. Happy To Help.
You need to add armv7s to your valid architectures under your Target's Build Settings.
You included src/Framework/Resources/Info.plist when added Facebook SDK files to your project. Just remove it from your project and everything will work again. Guaranteed! :)
I have solve the problem using the below steps.
Close the Xcode
Delete the application from device
Restart the device
then re-run the application
it is working fine..
Make sure the bundle name (in plist file) is same as the project name. I changed it and it worked.
One of my 3rd party libraries couldn't run on armv7s so I removed that option. I also removed armv6 and kept armv7 as the only option. It built and ran on the phone with only armv7.
I have solve the problem using the below steps.
Close the Xcode
Delete the application from device
Restart the device
then re-run the application
it working fine..
I faced this problem because Build settings-> Complier for C/C++/Objective c was set wrong.
So I changed it to default compiler available, it worked!
Just need to select the compiler LLVM in
Targets --> Build Settings --> Build Options
I ran into the same problem. When I check the compiler it is showing incompatible compiler. you need to make it valid one. To set valid compiler follow the steps
select your
project----> build settings-->
on the search bar type compiler and search
now you can find build options under build options you will find compiler for c/c++/objective c set it to valid one.
So basically I created a new project, copied all the sources and everything seems to work fine. At least the app runs.
I am not sure which setting was causing the problem.
I had an issue with an out of data library that was built for iOS 4.x and I was building a new app for iOS 6 with iPhone 5 support. I received this error and the only way I resolved it was to make armv7 the only architecture and valid architecture listed in my project and target build settings.
remove info.plist refrence. And then re-drag info.plist to proj but don't copy to "target"
You just goto Build setting Then valid architecture Replace armv7 armv7s instead of armv7 .Then it will work fine .
Ok, not sure if this is the Problem in Your Project. But what fixed it for me, was to change the Name of the Info.plist File.
I changed the name from Info.plist to my-project-info.plist
also change it under target-build-settings/Packaging/Info.plist
Than delete the App from Devices/Simulators and re-run the App through Xcode
In my Case, everything worked fine since than. In my Case there was nothing wrong with the specifications made in the plist file or with the valid architectures.
some times this happens when your project was build in xcode 4.5 and you are trying to run in xcode 5.0.
so in my case I found the solution.
Change your compiler for C/C++/ObjectiveC Go to Build
Settings->Build OPtions->compiler for C/C++/ObjectiveC; select
Default(Apple LLVM5.0)
I'm running the latest version of Xcode and am try to create an app for IPhone with IAd integrated into it and I have tried to integrate it many ways, but I keep receiving this error every time, ld: warning: ignoring file /Users/mini/Desktop/TheDateGetter/iAd.framework/iAd, file was built for unsupported file format which is not the architecture being linked (i386) I'm guessing this is a framework issue, because all of the code and everything else it correct. All help will be appreciated, thanks!
Check under Build Phases for your target which frameworks are you linking against. You will need to remove then the iAd framework from /Users/mini/Desktop/TheDateGetter and link the correct one from the iOS SDK.
I've been receiving this warning since I loaded my project in last Xcode 4 preview. There was no warning before that but now I can't get rid of it even in Xcode 3.2. I've been googling but nobody seems to have the same error.
My project and target settings are correct (IMHO): Architectures: Standard (armv6 armv7), Base SDK: Latest iOS (currently set to iOS 4.2), Build Active Architecture Only: FALSE, Valid Architectures: armv6 armv7.
I compared every project setting with other projects and and found no differences. I even have recreated the project starting from scratch and copying classes, resources and frameworks with the same result.
I must say that the warning is not shown when I set Debug configuration.
I hope someone can help me because I don't know what to do. Thanks in advice.
I kept getting this error and it was driving me crazy. Then I realized I was building the project for Simulator instead of Device. Once I made the change, I was able to upload the app without a problem.
Several things spring to mind. Firstly that there is some file lurking around in the build directory. But I presume you have deleted the build directory. Secondly, that there is something lurking in your library directories. I think xcode puts some tempt files down in them now. Thirdly that something has gone funny is the core xcode setup.
So here's what I would try (the emphasis here is "try" - I don't know if any of this will work :-)
Make sure you have deleted the build directory.
Do a full un-installation of code. Clear out any developer directories and then re-install.
SOLVED!. Not a good solution though.
After a thousand tests I uninstalled Xcode 3.2.5 and installed 3.2.4. Everything went ok since then. Now I'm afraid of upgrade to last version again. :/
I have searched for hours however I still have no clue what is wrong with my configuration.
My project uses a self-written libray (myLib). This library is compiled to work only for simulator and it works perfectly there.
What do have to change so it compiles for my iPhone Device as well?
This is my current warning:
ld: warning: in /.../myLib.a, file is not of required architecture
This is my configuration (of myLib.a)
I found a lot of articles explaining the reason for this error however I could not find a solution:
The simulator runs on an x86
architecture, while the device uses an
ARM architecture.
What do I have to change to get my library working on my iPhone?
Thanks
Edit:
What I did so far:
Cleaned both projects
Set library to 'Device' (3.1)
Built the library
Dragged the .a file of my library into my application
Result:
This works in simulator but setting the active sdk to device still raises a file is not of required architecture error.
I also tried mahboudz ( thanks for your support) link.
It explains howto built the project using a shell script.
However XCode keeps complaining that the library file is of the wrong architecture and the build fails.
This has to be a really stupid beginners mistake.
You need to add both .a files,the one built for the device (build/$config-iphoneos)and the one built for the sim (build/$config-iphonesimulator) to the new project. Make sure you name them differently before dropping them in. This is how admob and similar offering ship their static libs.
You need to compile your library for Intel so the Simulator can use it (which I gather you have done already), and then compile it for ARM, so it can run on the iPhone. Then you have to merge the two libraries. There are different ways to accomplish that, or make it more automatic.
Here are some links to help you:
http://blog.stormyprods.com/2008/11/using-static-libraries-with-iphone-sdk.html
http://www.clintharris.net/2009/iphone-app-shared-libraries/
I've met the same problem too. But seems you don't need to drag two .a files into the app project to solve this problem. This is what I did:
Drag the static library project into app project's framework group
"Get Info" for the target in app project
Set the direct dependency of static library
Make clean all unnecessary builds(for example the simulator build) in the static library project
Build in the app project