build error on iOS 7.1 - Zxing - ios

Updated to XCODE 5.1/IOS 7.1 and tried to build my project which included Zxing library.
Getting the following error:
/Zxing/cpp/core/src/zxing/ChecksumException.h:3:9: '__CHECKSUM_EXCEPTION_H__' is used as a header guard here, followed by #define of a different macro
Error is occurring for the following code,
#ifndef __CHECKSUM_EXCEPTION_H__ //this line causes the error.
#define __NOT_FOUND_EXCEPTION_H__
.....
.....
#endif // __CHECKSUM_EXCEPTION_H__
Everything was perfect before the xcode 5.1 update.
I suspect recent migration of IOS 7.1 to support 64-bit architecture causes this error but i'm not sure.
I tried to remove 64-bit support from the Zxing library using this link but still it's not working.
Any help or suggestion would be greatly appreciated.

Looks like there are some underground compiler settings changes in XCode 5.1.
So to fix this issue you need add -w flag to ZXingWidget Other Warning Flags.
This flag completely disable all compiler warnings.
Select ZXingWidget framework.
Select ZXingWidget target in ZXingWidget framework.
Press Build setting tab and type "other wa" in search.
Add -w parameter flag to Other Warning Flags.
Here is a screen with steps how to add this flag:

Related

Which compiler settings are changed when I change target device?

I have an iOS project that builds fine for simulators, but which has compiler errors when built for a Generic Device or when I try to run on a real device through Xcode. NOTE: actual compiler errors, not linker or deployment errors. The errors are to do with mismatched types in typedefs - as if it's including headers from a different SDK, or has different preprocessor defines.
My question is - what compiler settings are changed when I change target device in the Xcode UI and where can I view the differences? I cannot see any differences when I look at the project settings and change the target device - specifically the deployment target version and SDK version appear unchanged.
The project used to build fine with any of these target devices under Xcode 7, but does not under Xcode 8. I suspect this is down to the version of the SDK that comes with Xcode. But for it to work with some target devices and not others it has to be changing compiler settings. This should be really simple to fix, if only I could see what changes it's making!
Here's the line (in my code) which fails to compile:
typedef void* IOSurfaceRef;
And here's the error message:
error: typedef redefinition with different types ('void *' vs 'struct __IOSurface *')
Please note I don't want help fixing the error or advice on what it's trying to do - I know it's not good. I'd just like to know which compiler settings are changed by switching target device.
It fails because CGBase.h contains this code:
#if !TARGET_IPHONE_SIMULATOR
typedef struct CF_BRIDGED_TYPE(id) __IOSurface *IOSurfaceRef __attribute__((swift_name("IOSurfaceRef")));
#endif
When you are building for a device the #if !TARGET_IPHONE_SIMULATOR preprocessor directive is true, so your code has two typedefs for IOSurfaceRef with conflicting types.

dyld: Symbol not found: _kABPersonAddressCityKey XCODE 8 issue

Hi My code was running perfectly in xcode 7.x.x
As soon as i updated my xcode i am getting this issue please give me the solution for this.
Details :
dyld: Symbol not found: _kABPersonAddressCityKey Referenced from:
/var/containers/Bundle/Application/0A16B18D-CB72-4FCA-94F7-422AFD1411AD/ABCD.app/ABCD
Expected in: /System/Library/Frameworks/PassKit.framework/PassKit in
/var/containers/Bundle/Application/0A16B18D-CB72-4FCA-94F7-422AFD1411AD/ABCD.app/ABCD
Add PassKit.framework to your Link Binary With Libraries in your Build Phases and set its Status to Optional
There are two things that might fix your problem:
1- Open your target -> Build Phases -> Link Binary With Libraries -> Add AddressBook.framework
2-
AddressBook framework was deprecated in iOS 9. Apparently your app will crash if you compile the code on Xcode 8 and run on a iOS 9 or lower device.
I recommend migrating to Contacts framework and/or have preprocessor macros that don't include the AddressBook framework code when built on iOS 10.
Source: https://github.com/OceanLabs/iOS-Print-SDK/issues/257
Paul Senabre's solution worked for me, thank you, thank you, thank you! This has been driving me nuts!
Adding PassKit.framework solved but problem, but make sure to add it for all of your targets! When you add it, it only affects your current target. BTW, my app with a target of iOS-8 ran fine with iOS-10 in Xcode-8, but would crash with anything previous to iOS-10.

Can't compile Aviary on iOS since SDK 4.4

I can't run my app only on the iOS Simulator since I updated to Aviary SDK 4.4.
I can run the app on my iPhone and iPad.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: 30 duplicate symbols for architecture x86_64
The framework and the bundle are visible in "Link binaries with Libraries" and "Bundle ressources".
The Framework search path is OK in build settings.
It looks like the Aviary framework was managed twice ?
I leave/restart Xcode, clean the app in iOS simulator, clean target and destroy DerivedData without success.
Very strange I have no problems in the real devices.
I got this problem resolved. Here is how:
Solution
Do not use #import <AviarySDK/AviarySDK.h>, instead of that, import the classes that you're using directly. Like: #import <AviarySDK/AVYPhotoEditorController.h> etc.
Reason
The reason I believe lies in the newly introduced AVYPhotoEditorCompatibility.h, which is by default included in <AviarySDK/AviarySDK.h>.
I think here is the problematic code that is using typedef with const
typedef AVYPhotoEditorPremiumAddOn AFPhotoEditorPremiumAddOn AVY_PREMIUM_ADDON_NAMESPACE_DEPRECATED_ATTRIBUTE;
AVY_PREMIUM_ADDON_NAMESPACE_DEPRECATED_ATTRIBUTE AFPhotoEditorPremiumAddOn const AFPhotoEditorPremiumAddOnNone = AVYPhotoEditorPremiumAddOnNone;
AVY_PREMIUM_ADDON_NAMESPACE_DEPRECATED_ATTRIBUTE AFPhotoEditorPremiumAddOn const AFPhotoEditorPremiumAddOnHiRes = AVYPhotoEditorPremiumAddOnHiRes;
AVY_PREMIUM_ADDON_NAMESPACE_DEPRECATED_ATTRIBUTE AFPhotoEditorPremiumAddOn const AFPhotoEditorPremiumAddOnWhiteLabel = AVYPhotoEditorPremiumAddOnWhiteLabel;

Cordova 3.4, Xcode 5.1 and iOS 7.1

I was building my project perfectly but after updating iOS to 7.1, I was then forced to update Xcode 5.1 and now I'm getting error and warning messages:
4S 7.04 – builds – no error or warning messages
5S 7.1 – doesn’t build – mixture of error and warning messages:
26 x Value conversion issue
Implicit conversion loses integer precision:
12 x Linker build errors
Then I do the steps outlined in this blog post to remove linker errors – delete all conditional architecture and make sure arm64 is in the all the projects and targets: http://shazronatadobe.wordpress.com/2014/03/12/xcode-5-1-and-cordova-ios/
4S 7.04 – builds – warning messages:
12 x Format String Issue
Values of type ‘NSInteger’ should not be used as format arguments; add an explicit cast to ‘long’ instead
5S 7.1 – doesn’t build – warning messages:
26 x Value conversion issue
Implicit conversion loses integer precision:
12 x Format String Issue
Values of type ‘NSInteger’ should not be used as format arguments; add an explicit cast to ‘long’ instead
I think the warning messages are now affecting the badges as they are not reseting correctly
Are the warning messages relevant? And would they likely be affecting resetting the badges?
Okay, so I have gone back and forth with this for a while and I've got a few possible solutions for you.
Make sure in Xcode you are selecting both your project and the target within that project also and make sure your settings are setup like the forum post you mentioned.
Make sure you also change the settings on the CordovaLib project as well. Both the project and the target need to be changed, but it's slightly different. you also need to add i386 as a supported platform in the cordova project, but is not needed in yours.
Other things to check are.... Make sure you are using the right kind of provisioning profile... ie. Distribution for production phone builds and Development for team builds and testing on your device.
Check and make sure you are not missing a library you needed to import. You can usually tell if you are missing a library by the mach-o linker errors though.
Example: I removed a plugin from my phonegap project via command line. Well then I added it back and my project would not build using the 'phonegap build ios' command. I had to open the XCode version of my project within xcode then re-import the AudioToolbox library under the Linked files and then I was able to build again via command line.
Good luck, comment here if you need more help.
Please check my attached images might be it will helpful for you.

Facebook SDK giving unused variable compile errors in Xcode 5.1

I'm getting a lot of unused variable errors after updating to the new version of and Xcode 5.1.
Compiler is saying unused variables are errors, and checked the compiler settings that i didn't modify treating warning as errors.
This only happened after I updated to Xcode 5.1
There seems to be indeed an issue with Facebook iOS SDK and compiling on Xcode 5.1 even if compiling it by itself.
I opened a bug in the Facebook support system:
https://developers.facebook.com/x/bugs/1449419898627543/
As a temporary workaround - you can fix it by turning off treating warnings as errors ( a very good practice by itself btw I use for our SDK) by:
1. Open the Facebook proj file (or the project inside an existing project
2. Go to build settings of the entire project
3. Change the "Treat Warnings as Errors" field from YES to NO.
This will let you compile it even with these warnings - but do be alert for an updated sdk in the coming days.
The problem was that we were unintentionally compiling for 64bit in the internal compiler settings somewhere inside our scripts. Please be aware.

Resources