iPhone Build fails - XCode 5.1.1 iOS 7 - ios

I've followed this bar code scanner tutorial http://rdcworld-iphone.blogspot.com.au/2013/03/how-to-use-barcode-scanner-br-and-qr-in.html which runs fine in the simulator. However it says "Build Failed" when I connect my iPhone and attempt to build it. There are no errors. My phone version is 7.1.2 if that helps.
What process should I follow to find what the cause/s of the failure are?
Edit:
I am not using an _ or space in the project name.
Edit:
Error log for iPhone:
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a file '/Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a' for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The error log for iPhone 4 64 bit simulator:
ld: warning: ignoring file /Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a, missing required architecture x86_64 in file /Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a (3 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ZBarReaderViewController", referenced from:
objc-class-ref in ViewController.o
"_ZBarReaderControllerResults", referenced from:
-[ViewController imagePickerController:didFinishPickingMediaWithInfo:] in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
(null): Ignoring file /Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a, missing required architecture x86_64 in file /Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a (3 slices)
(null): "_OBJC_CLASS_$_ZBarReaderViewController", referenced from:
(null): Objc-class-ref in ViewController.o
(null): "_ZBarReaderControllerResults", referenced from:
(null): -[ViewController imagePickerController:didFinishPickingMediaWithInfo:] in ViewController.o
(null): Symbol(s) not found for architecture x86_64
(null): Linker command failed with exit code 1 (use -v to see invocation)
Edit:
I've got it to work fine on the iPhone by downloading and using the latest zbar sdk framework. Now however the simulator doesn't build as it wants the old one!
Anyone have an idea how to make both the phone and simulator happy?
Edit 2:
I got it working use the old libraries, but not the latest which is what I have to do for work. For the old libraries I did the following:
1) Create a new app and make it universal.
2) Follow the normal tutorial steps except use a storyboard not a xib file and set the project to use that for both iphone and ipad. Also don't put in the code near the end of the tute which specifies which Xib to use since I'm not using one!
3) In build settings set the Architectures and Valid Architectures to "armv7"
4) In build settings set Build Active architecture only to YES
What I've done just recently is to remove the old ZBar libraries and replace them which these http://www.nerdvision.net/app-development/ios/zbar-sdk
It gives me this error though:
ld: warning: ignoring file /blahblah/BarcodeScannerNew/BarcodeScannerNew/zbar_iOS7_Fix/libzbar.a, missing required architecture i386 in file /blahblah/BarcodeScannerNew/BarcodeScannerNew/zbar_iOS7_Fix/libzbar.a (3 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ZBarReaderViewController", referenced from:
objc-class-ref in AACsViewController.o
"_ZBarReaderControllerResults", referenced from:
-[AACsViewController imagePickerController:didFinishPickingMediaWithInfo:] in AACsViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I think what that means is it wants the old (I presume 32 bit) libraries, not the latest ones. Not sure how to fix it though as I can't include both old and new Zbar files because it gives an error about duplicate files.

Doesn't look like ZBar is supported on iOS7. Last update was around iOS4 since when a lot has changed.
Source ZBar FAQ

Error says that zBar library isn't compiled for 64-bit simulators. So you'd either build library from sources with this support or wait for somebody to do it. Or just don't use 64-bit simulator for this. :)
This answer may help you to get this working on 64-bit simulator.
Also if you can support only iOS 7+, you can use system built-in code scanning capabilities.

Related

Undefined symbols for architecture arm64: "_OBJC_CLASS_$_InterstitialAdView", referenced from:

I have created a framework & integrated in the another app(Demo). When i run this Demo app on simulator then there is not any error...
But when do i run on device its gets error.
ld: warning: ignoring file /Users/mac/Desktop/library file/Demo/pk.framework/pk, file was built for x86_64 which is not the architecture being linked (arm64): /Users/mac/Desktop/library file/Demo/pk.framework/pk
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_InterstitialAdView", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please share your experience.
I am using Xcode 9.0
Thanks
You have to know simulator and devices have different cpu types, when you build Xcode will build the app and link the libraries according to the target type.
From the error info, it seems your framework only provide the x86_64 architecture (for simulator), you should build your framework for the device architecture (arm64) instead !

I try to integration with zooz sdk in ios but it give some error, so please provide me a right solution

I try to integration with zooz sdk in ios but it give some error, so please provide me a right solution.
Ignoring File
/Users/xyz/Desktop/Zooz.com/ZooZSDK.embeddedframework/ZooZSDK.framework/ZooZSDK,
missing required architecture x86_64 in file
/Users/xyz/Desktop/Zooz.com/ZooZSDK.embeddedframework/ZooZSDK.framework/ZooZSDK
(3 slices) Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ZooZ", referenced from:
objc-class-ref in DemoZooZSDKViewController.o "_OBJC_CLASS_$_ZooZInvoiceItem", referenced from:
objc-class-ref in DemoZooZSDKViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with
exit code 1 (use -v to see invocation)
Experienced the same issue when following the installation instruction on their Github. Finally, I've downloaded the source code and built using Carthage for all architectures. This allowed me to run on simulator and physical device.

TI SmartConfig Framework not working in iOS Simulator

I used TI smartConfig Framework in my APP to Configure CC3000 Modules.The Code downloaded from Texas Instruments Site was not working in Simulator and Showing the following error, but it's working when Device connected.
ld: warning: ignoring file /Naresh/CC3000_Smartconfig_iOS_Source-1.1/src/CC3x/libFTC_DEBUG_ARM_64.a, missing required architecture i386 in file /Naresh/CC3000_Smartconfig_iOS_Source-1.1/src/CC3x/libFTC_DEBUG_ARM_64.a (2 slices)
ld: warning: ignoring file/Naresh/CC3000_Smartconfig_iOS_Source-1.1/src/CC3x/libFTC_RELEASE_ARM_64.a, missing required architecture i386 in file /Naresh/CC3000_Smartconfig_iOS_Source-1.1/src/CC3x/libFTC_RELEASE_ARM_64.a (2 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_FirstTimeConfig", referenced from:
objc-class-ref in CC3xUtility.o
objc-class-ref in CC3xMainViewController.o
objc-class-ref in CC3xMainViewController_iPad.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
According to this post, it does not work on Simulator because you need real hardware to test its functionality. However, apparently they think that apps using this library don't have any other function/UI to test in simulator. That's why they don't provide universal library.

IOS App Archive Failing - 2 errors

I have just added 64 bit support for my iPad app in Xcode. Before the update i was able to archive the app with no red errors. After i add arm64 in the build settings get 2 error preventing the archive:
*ld: warning: ignoring file /Users/****/Documents/mApp/****/Pixate.framework/Pixate, missing required architecture arm64 in file /Users/****/Documents/mApp/****/Pixate.framework/Pixate (3 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_Pixate", referenced from:
objc-class-ref in main.o
objc-class-ref in BaseView.o
objc-class-ref in BaseViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)*
I have checked the framework and it is showing in the frameworks in the project.
I am currently using Xcode version 6.3.2 (6D2105)
The problem is related to third party framework Pixate.framework.
This framework is not built for arm64. That's why you got these errors.
How to fix it: find the version of this framework that was built with arm64 or just build it yourself by getting code from GitHub

Architecture issue in iOS

I'm using Reachability on my project to get the type of connection used, but an error has ocurred.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Reachability", referenced from:
objc-class-ref in ContributionViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't know what to do... my project is for iOS 4.3 and I've never had this kind of problem before.
Thx
Did you include the reachability framework in your projects linked libraries ? You can confirm by clicking on your project file on the file list and checking the build phases tab. It should be listed in the linked library section,

Resources