I just installed Xcode 4 and am getting this error in my project:
ld: warning: directory not found for option '-LDebug-iphonesimulator4.3'
ld: warning: ignoring file /Developer/Projects/BuildOutput/Release-iphoneos/libMyFramework.a, missing required architecture i386 in file
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MyRandomNumber", referenced from:
objc-class-ref in myAppDelegate.o
objc-class-ref in RootViewController.o
I have the project set to iOS 4.3 Simulator. I did check that scheme and it is set to debug build configuration. Why does it reference a Release version of the above library?
Also, what is the i386 error about?
I'm seeing this type of error as well. The odd part is that I've been building, linking, and running successfully under the Simulator. I just now tried to fire my app up in my iPhone, and am totally bombing out during the link process.
I've run my app on my iPhone before. I've been building it under Xcode 3.2.x for the last year, and have never seen this problem.
A couple of other SO threads indicate that it could be due to copying a framework into the project folder, and that one should just "move the framework." Okay. Where, and how do I let Xcode know where it is? And if that's not the problem, then what is?
Xcode 4 has a ton of promise, but it is a sore pain in the ass sometimes....
Related
I have an M1 MacBook Air.
When building for a simulator in Xcode, I am seeing the following warnings and errors:
ld: warning: ignoring file /Users/kon/Library/Developer/Xcode/DerivedData/InvisibleComputersApp-hktlnhvaoskvxkcdhnahydmbodzw/Build/Products/Debug-iphonesimulator/GoogleSignIn.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/kon/Library/Developer/Xcode/DerivedData/InvisibleComputersApp-hktlnhvaoskvxkcdhnahydmbodzw/Build/Products/Debug-iphonesimulator/AppAuth.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file
/Users/kon/Library/Developer/Xcode/DerivedData/InvisibleComputersApp-hktlnhvaoskvxkcdhnahydmbodzw/Build/Products/Debug-iphonesimulator/GTMAppAuth.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/kon/Library/Developer/Xcode/DerivedData/InvisibleComputersApp-hktlnhvaoskvxkcdhnahydmbodzw/Build/Products/Debug-iphonesimulator/AppAuthCore.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/kon/Library/Developer/Xcode/DerivedData/InvisibleComputersApp-hktlnhvaoskvxkcdhnahydmbodzw/Build/Products/Debug-iphonesimulator/GTMSessionFetcherCore.o, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-arm64
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GIDConfiguration", referenced from:
objc-class-ref in GlobalState.o
"_OBJC_CLASS_$_GIDSignIn", referenced from:
objc-class-ref in GoogleAuthService.o
objc-class-ref in GoogleRefreshTokenService.o
objc-class-ref in InvisibleComputersAppApp.o
"_OBJC_CLASS_$_GIDSignInButton", referenced from:
objc-class-ref in LoginView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This sounds to me like Xcode is somehow trying to build an x86 binary? Why is it even trying to do that, aren't the simulators arm based on the M1 Macs?
How can I
I spent 3 days on this issue beating my head against the wall. Today, I finally cracked it and understood the problem.
I am working on a highly modular project with ~100 frameworks. When migrating from the X86_64 (Intel) architecture to arm64 (M1) I was always getting this error:
Could not find module 'MyModule' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at /my/path/
when building natively on M1.
The reason is that the simulator runs natively on M1 but the simulated app runs still under Intel. That's why the x86_64 architecture was built in the first place.
The two architectures are now beating each other as the simulator is arm64 while the simulated app is X86_64. Removing the arm64 architecture for the pods and project settings fixed the issue and I can build the project entirely on M1 now.
Here are screenshots from the ActivityMonitor. AchieveMe is the app running in the simulator.
To fix the problem for Cocoapods you can simply do:
target.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
end
I am using XcodeGen and there it can simply be added under debug configuration as:
YourSettings
...
configs:
Debug:
EXCLUDED_ARCHS[sdk=iphonesimulator*]: arm64
Best of luck, I hope it helps. I can sleep in peace now.
You can try opening Xcode with "Open using Rosetta" check ON.
Quit Xcode
Go to your Applications folder
Right click Xcode then select "Get Info"
Check "Open using Rosetta"
Open Xcode
If you have a dependency that does not support arm64, you can tell the build system to skip arm64 (this building x86_64) by adding "arm64" to the list of excluded architectures (EXCLUDED_ARCHS) in your targets' build settings.
I've read close to 50 threads on here, regarding linking frameworks to an Xcode project, but I've yet to find one that covers an issue I'm having with Facebook's Audience Network framework.
I'm using Xcode 4.2.3 (I'm on an old mac with OS X Lion - don't ask!), building for iOS 6.1, using Facebook SDK 3.2.1.
I'm trying to test banner ad formats within specific view controllers, however, getting an error every time I build the code, based exactly on the tutorials, even Facebook's sample code isn't compiling. I've added FBAudienceNetwork.framework to almost every folder on my machine, added via dragging and dropping, and via the Link Binary with Libraries option. I've tried to changing the Framework Search paths, to no avail.
I'm using the following frameworks: AdSupport, StoreKit, CoreMotion, UIKit, Foundation, CoreGraphics
Getting the following error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CAShapeLayer", referenced from:
objc-class-ref in FBAudienceNetwork(FBAdChoicesView.o)
"_OBJC_CLASS_$_CATransaction", referenced from:
objc-class-ref in FBAudienceNetwork(FBAdUtility.o)
objc-class-ref in FBAudienceNetwork(FBAdMediumRectangleView.o)
"_OBJC_CLASS_$_NSURLSession", referenced from:
objc-class-ref in FBAudienceNetwork(FBAdUtility.o)
"_kCATransactionDisableActions", referenced from:
-[FBAdMediumRectangleView updateViewForSize:view:] in FBAudienceNetwork(FBAdMediumRectangleView.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any suggestions?
UPDATE: Added in Quartzcore.framework, and errors now reduced to;
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_NSURLSession", referenced from:
objc-class-ref in FBAudienceNetwork(FBAdUtility.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've made Foundation.framework optional. Build settings armv7, armv7s, iOS 6.1, Simulator only. Build Active Architecture ONLY Yes/No.
I'm a software engineer on the Audience Network team at Facebook, and I have some suggestions that may help.
Try adding "QuartzCore.framework" to your target. That should resolve the _OBJC_CLASS_$_CA* linker errors. Classes with a "CA" prefix are part of QuartzCore/Core Animation.
If the "_OBJC_CLASS_$_NSURLSession" error still appears, try weak-linking the Foundation framework by setting the "Foundation.framework" to "optional" in Build Phases, Link Binary With Libraries.
You should be able to successfully build after those steps. Hope that helps!
NSURLSession was added in iOS 7.0. Any improper reference to it in your app will cause this problem when ran on a device with iOS 6.0. You need to use proper techniques to ensure the class is never referenced under iOS 6.0 or make your deployment target iOS 7.0.
i am new in ios developement.i have a project while run on ios 5.1 simulater it is working fine and not getting any error but in that same project while run on ios 6.0, ios 6.1 simulator i am getting following errors.Can anyone suggest me how can i rectify this problem?
Errors:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GDataOAuthAuthentication", referenced from:
objc-class-ref in GDataOAuthViewControllerTouch.o
"_OBJC_CLASS_$_GDataOAuthSignIn", referenced from:
objc-class-ref in GDataOAuthViewControllerTouch.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Try this,
The main problem was,I thought you are using old GData sdk. You just
change the compiler to LLVM GCC 4.2 from Apple LLVM 4.2 and it
compiles app perfectly.
i have attached screenshot for your reference
Project->Target->Build Settings->Build options
You're linking against external libraries that haven't been compiled for your current architecture/SDK version. I see you're using VDOAds library, which was probably precompiled against the 5.1 SDK. You'll need to get a version that was precompiled for the latest iOS SDK.
TargetSettings -> Build Phases -> Compile Sources and make sure that these missing libraries are included there.
So you have two problems, for the warnings, the libraries were added to your Build Phases but they were deleted from the project and they are still there.
For the error, the library that you are using is not added to Build Phases -> Link Binary With Libraries.
So in order to fix this warnings/errors, go to your project Targets -> Build Phases -> Link Binary With Libraries, and search for libGoogleAnalytics (I think this is the one for GA) and remove it (if not needed).
Also add the VDOAds library there in order to fix the error.
I also add a screenshot with the targets, it will be easier to find it if you don't know about it.
My app compiles fine on the iPhone simulator running iOS 5.0, but it fails on my older physical iPod touch running iOS 4.2.1.
I'm getting the following error:
Undefined symbols for architecture armv6:
"_OBJC_CLASS_$_TestFlight", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture armv6
I've looked at other questions about this:
Undefined symbols for architecture armv6, Updating to iOS 4.3
But they're solutions do not work. Indeed, TestFlight.h was not in Compile sources, but dragging it to Compile Sources did not change the error message. (There is no TestFlight.m; I have libTestFlight.a in "Link Binary with Libraries"
Similarly, deleting and retyping #import "TestFlight.h" in AppDelegate.m did not change anything.
What else could be causing this compile error on my iPod?
First, a .h file is not a source file, so remove it from "Compile Sources" again.
About the error - you are probably using a version of the TestFlight SDK that does not support armv6 - they re-enabled this architecture in a recent version. Update to the newest version of the SDK and see if that helps.
Click on your project, select
Target
and then goto
Build Phases
In
Compile Sources
added AppDelegate.m, it might not be connected, compiler is unable to find the file.
Also see link
I just updated to Xcode 4 and iOS 4.3 but now when I try to build/run my project, it returns the following JSON SDK error:
ld: warning: ignoring file /var/folders/OV/OVQ5LuaPFY4lW0L0a9jdRk+++TI/-Caches-/com.apple.Xcode.501/CompositeSDKs/iphoneos-iPhoneOS4.3-dqtvoenrseczxwakgamuhnlmhcbu/usr/local/lib/libjson.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_SBJSON", referenced from:
objc-class-ref in Neighbourhoods.o
objc-class-ref in StreetLevel.o
...
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status
After upgrading to Xcode 4, it now seems to be trying to build for release whereas in the old versions I believe it was building for debug, but I can't seem to see where I can change that.
I've got the JSON SDK installed under ~/Library/SDKs/
The SDK has been added to the Additional SDKs section for both release and debug. I've also made sure that the following 'Other Linker Flags' are also added to both release and debug: "-all_load -ObjC -ljson".
After checking/adding all that, it still won't build.
Anyone able to shed any light on this problem?
I'm not sure why in the end it stopped working after the update, but I have now removed the SDK and just added the source code to the project, not ideal but it works.
I had the same error when building a third-party library, when under 4.2.6 it didn't complain before. Open up the library project, go to the menu "Project --> Edit Project Settings --> Build Tab" and look under "Architecture".
Under the sub-items "Architectures" and "Valid Architectures" check that they contain a reference to "armv7". If not you will have to select/add it.
Do the same for your active target: menu "Project --> Edit Active Target --> Build".
After making the changes, build again, and you should not have linker errors.
I had working project that failed to link after I switch to SDK 4.3 after updating Xcode 4. I removed ARM7 from the target architecture, leaving only ARM6, and that fixed it. A shot in the dark but perhaps others can use this workaround too.