Validation error for iPhone app using ZBar SDK - ios

I have an iPhone app (for iOS 7 & above) which uses the ZBar SDK. I'm struggling to update it for iOS 7 using Xcode 5.1.1.
I was getting this arm64 build error, but I've managed to fix that by recompiling libzbar.a according to the instructions here.
The app now archives successfully. However, when I try to validate it in the Xcode Organizer I get the following error: "This bundle is invalid. Apps that include an arm64 architecture are required to include both armv7 and armv7s architectures."
I have "Standard architectures (armv7, armv7s, arm64)" set for my project's Architectures and "arm64 armv7 armv7s" for the Valid Architectures.
I not sure what else to try at the moment, so any help would be much appreciated.

Unplugging my iOS device and re-archiving the build helped me.

I could not find anything that would solve this problem. After going around in circles for several days, I removed every trace of the ZBar SDK from my app and instead used Apple's AVFoundation for QRCode support. This option was not available prior to iOS 7, but now that it is life becomes a whole lot easier!

Related

iOS - Why build failed on simulator, but success on device/Generic iOS Device?

I have a doubt, when we set target device and build a normal working project then it builds success, but same project when I change target to simulator OR Generic iOS Device then it fails. I have shared screen shot for error details when I build a working project on simulator. What's the reason behind this why same code builds + runs perfectly on iphone devices OR Generic iOS Device, On the other hand fails on simulator? Please note that, I have added already necessary Framework in my project. Any suggestion will be great. Thanks guys.
http://i.stack.imgur.com/CJTim.png
it means the supporting frameworks are missed
for _OBJC_CLASS_$_SKStoreProductViewController
add StoreKit framework
for _OBJC_CLASS_$_asidentifiermanager
add AdSupport.framework
for _OBJC_CLASS_$_CMMotionManager
add
CoreMotion.framework
Whenever you encounter such issue, I recommend on using the 'lipo' tool of Apple. you call it like this:
/usr/bin/lipo -i <path-to-libraray-file>.a
The response will be:
Architectures in the fat file: <the-lib>.a are: armv7 arm64
I guess that in your case, the library which provides the ASIdentifierManager will only show armv7 and arm64 which are required to run on real devices, but not i386 required for the simulator.
So the question is where this library is coming from. If you got it from a 3rd party, ask them to provide a 'fat' library which include all the required architectures, including one for i386
Your mac (simulator) running on i386 architecture. If you compile your static libraries for i386 as well you will be able to use them on the simulator.
Try adding "i386" to the "Valid Architectures"

Removing i386 and x86_64 from an embedded Cocoa Touch framework when archiving

Urban Airship provides an iOS 8+ framework called AirshipKit.framework. Linking and embedding this framework works fine in both the simulator and device. However, when I go to archive the binary and validate it, iTunes Connect says the app contains code for unsupported architectures i386 and x86_64. How can I get Xcode to remove support for these architectures from the archived app?
Under Build Settings I have:
Architectures: Standard architectures (armv7, armv7s)
Build Active Architecture Only: Yes for debug, No for release
Supported Platforms: iOS
Valid Architectures: arm64 armv7 armv7s
You could use lipo to extract the arm code to a new file and submit that one, but it sounds like something is very wrong - you shouldn't need to do anything like this to submit, it might be a bug in Xcode. Which version are you using? Did any other settings in the build get changed (the text would be bold if the build setting is modified from the default)?
There is a new version of the Urban Airship SDK, 5.0.3
Are you still seeing this issue when building with the new Framework version?
I struggled with the same problem for a couple of days until I realized my own idiocy. My app is set to support 7.0+ and yet I still had the Airship.framework, which as the UA (Urban Airship) documentation strictly recommends, was only to be used for 8.0 +
I removed the framework and the validation came back success!
So if your app is inclusive of 7.0 or lower, then all you need is the libUAirship-5+ library. As #aschuman suggested, there is a new one available (libUAirship-5.0.3.a)

ZBar with iOS7 and XCode5 compiling error libzbar.a architecture

just got some errors runnign ZBar with my iOS App.
I included the newest Beta Version 1.3.1 in my Project and am Running the App locally on my iOS7 Device (iPhone 5).
When trying to archive it for Distribution, there is the error with arm64.
I've tried to recompile the source to generate my own libzbar.a (which was generated) with selected arm64 armv7 and armv7s, but even here the error was the same..
So what should I do?
Thnaks for help!
You can download the zbar library compiled for arm7, arm7s and arm64 here
EDIT: I am still getting upvotes on this answer, the real current answer is that now the AV Foundation framework includes barcode scanning as of iOS 7. I would recommend using this over ZBar from here on out.
Useful tutorial using AV Foundation to scan with sample code and supported types list or here
above answers don't really help
follow this guide:
http://www.federicocappelli.net/2012/10/05/zbar-library-for-iphone-5-armv7s/
But before building change the Architectures to include arm64
I was on the ZBar train as well for quite a while dealing with these issues since they have not been updating the SDK. Luckily if your app only has to support iOS7 onwards (which most iOS users are on now!) there is now QR Code reading support in AVFoundation so you can build your own reader very easily. Check out this tutorial:
http://www.appcoda.com/qr-code-ios-programming-tutorial/
Then bask in the beauty that is a totally Apple supported QR Code reader!
Using the beta you linked and changing this setting worked for me:
Settings that worked:
I am able to build to the 5s and 5c.
Try only armv7, armv7s for "Architectures" build settings. I think static library doesn't have arm64 binaries included.
For more info
Xcode 5 and iOS 7: Architecture and Valid architectures
Here (http://zbar.sourceforge.net/iphone/sdkdoc/install.html) is the installing SDK guide, I did this and it worked perfectly.
Hope it helps.
How i resolve the problem is link binary with libraries. Base on the tutorial here
Now Select project (Blue Icon) go to --> Build Phases --> Link Binary With Libraries.
Click the + and add each of these seven frameworks.
AVFoundation.framework
List item
CoreGraphics.framework
CoreMedia.framework
CoreAudio.framework
CoreVideo.framework
QuartzCore.framework
libiconv.dylib (I use libz.tbd & libicon.tbd)
**set enable bitcode --> No
build! hope this help.

No architectures to compile for (ARCHS=, VALID_ARCHS=armv7 armv7s)

I am using Xcode 4.5.2 and have a project which cannot be compiled for an iPhone running iOS 6.0.1 though other projects compile fine with the same settings as shown in the picture below.
Any ideas on how to solve this?
You're probably using some third party lib that doesn't yet support armv7s architecture. You can just remove armv7s from your settings. Your app will still be able to run on iPhone 5 although it might not be taking full advantage of the new architecture.
If on XCODE 12 just goto Build Settings search for VALID_ARCHS. Under the User-Defined section select Valid Architectures and click Delete.
Set valid architecture for iOs simulator to armv7 and armv7s.( simulators are 32 bit ).
for device set to arm64 (64 bit all new ios device).

iOS - Integrating MGTwitter without armv7s

I'm using MGTwitterEngine in my apps and till iOS5, the app is working fine. I'm using twitter engine that as ".a" file.
But when compiling with latest XCode, its showing error that armv7s slice is not available.
I tried removing armv7s from the valid architectures and the problem solved. I'm able to build the app, run the app successfully on iPhone4, iPhone4S and also on iPhone5.
My questions is whether I'm following right way or not. Will Apple approve the apps that are not built with armv7s architecture?
There's no other go with it
Libraries are precompiled code. so they are built as per the architectures selected during compilation.
In latest iOS, its better to use Twitter/Social framework (as per iOS version)

Resources