I am working on a iOS app that uses a commercial static library (.a) which is compiled for armv7 architecture. This works fine but it does not work on iOS 9 because Apple requires that all libs should support arm64.
Until now the vendor of this library will not deliver me a arm64 version of this library.
I've googled this a lot lately but cannot find a solution or workaround to make this work.
Many posts also on stackoverflow say this will not work.
I've tried, as some posts say, to add -Wl,-segalign,4000 to the other linker flags in the build settings of XCode in the target of my project but it did not work.
So this probably will not work, but I was wondering does anyone know a solution/workaround so that my app with this static library will work on iOS 9?
Thanks in advance.
As you have ascertained there is no solution here other than obtaining a 64-bit library from the vendor. I am in the same boat with an internal application I own that leverages a vendor's (antiquated) framework that is based on armv7. Until you get your hands on a 64-bit version of that library you are dead in the water.
Related
I am trying to integrate Google cast SDK but not working in Apple M1 Pro chipset.
pod 'google-cast-sdk'
I am tried with every possibilities but not worked well and it's throwing as error like attached image. Any idea to get rid of this error.
Any help more appreciated.
Thanks in Advance
The Google Cast SDK you integrate with CocoaPods contains a binary framework which currently does not contain the arm64 simulator binaries, thus the linker error you experience when building the project for the arm64 simulator.
arm64 simulator binaries are namely different from arm64 device binaries, as this excellent article series explains in great detail. An XCFramework is needed instead so that both the arm64 device and simulator slices can coexist in the same package, thus addressing all possible build scenarios.
Google engineers are currently working on this known issue and a proper XCFramework should be delivered early January 2022 for version 4.7 of the Google Cast SDK. Though this is not mentioned explicitly I hope they will update the pod accordingly at the same time.
At the time of this writing (early January 2022) this XCFramework should be around the corner, so I would recommend working with the x64 simulator or an arm64 device in the meantime if you can.
If you cannot afford this compromise you can transform arm64 device binaries into arm64 simulator binaries. The article series listed above describes how this can be achived both for static as well as dynamic binaries, as Google Cast provides its SDK in both flavors.
Can try. Target > Build Settings > Architectures > Excluded Architectures > Debug > add "arm64"
I have two questions basically.
Scenario is that I have a(n) NMI Payment Gateway SDK
the SDK or library won't work under simulator environment. Though it is logically right since the sdk is for reading mag data I can't test other parts of my app on a simulator ( And I have limited resource on device ). Is there a way to recompile the sdk or based on my research how can I create a static library so that I can generate a i386 architecture based sdk. Or better yet is there a way that I can check if environment is i386 then don't load the sdk?
I tried creating a(n) app using the SDK mentioned above. I would like to run it using an iPhone5s device and arch (armv64, armv7 and armv7s) but it says 'undefined symbols for armv7'. Would there be a way to somehow recompile the sdk and enable it to run on newer architecture?
Any help is much appreciated. THANKS
We use different targets for simulator and for device, and in code use macro TARGET_IPHONE_SIMULATOR.
example:
#if (TARGET_IPHONE_SIMULATOR)
NSLog(#"device");
#else
NSLog(#"simulator");
#endif
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.
I have an SDK to achieve some special stream of video but I've got only the binary of this, I think this was built for arm7.
I have an app built with this library and it runs great on iPhone 4, 4s and iPad 2 but when building for iPad 4th generation with an arm7s xcode shows lots of errors about files being ignored.
I'm pretty sure it's the architecture cause changing the build architecture the errors appear and disappear.
Is there any way to make this work? I mean build for new architectures having only binaries files of the old one?
Unfortunately not. To build your app for armv7s all the code – which includes said library – has to be built for it. There is a hack to add armv7s support to static libraries but I would strongly recommend against using it.
That being said, for now it's not a big deal if you're building your app for armv7 only. It will still work fine on the iPhone 5.
Just go into the build settings of your Target and set "armv7" as the only architecture your app should be built for.
At one point in the future Apple will probably require that all new apps / app updates will be built for armv7s, like the did with armv7 a few years ago, but for now it's not a problem. By then the developer of the static library will hopefully have provided an update.
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)