Lexical or Preprocessor Issue with Accounts framework - iphone

I recently installed the latest Facebook iOS SDK and included the Accounts framework for use with it. While I don't think the issue is related to the Facebook iOS SDK, I thought I'd mention it.
The error I'm getting when I compile now is this:
Pasting formed '_MAC#', an invalid preprocessing token
There are 3 of these errors, all within the Accounts framework header files that I cannot edit.
I'm using the default compiler: Apple LLVM compiler 4.2 with XCode version 4.6.3
I tried researching this issue for hours to no avail.
UPDATE: I tried compiling with Apple LLVM compiler 5.0 in XCode 5 Beta and I get even more compiler errors related to the Accounts framework.
UPDATE: I started a totally new project and rebuilt it from scratch. The same issue persists. As of now, it seems like my only option is to not use the new Facebook SDK or Accounts framework. I'm surprised no one else has this issue.

Have you set the Accounts.framework as "optional" under target settings?
Make it "Optional" and then Clean, Build and Run Project.

Solved it. I had a #define that looked like this in the pch file:
#define NA #"-"
Note to self. Do not use short define names in global header files.

Related

Invalid Swift Support xcode 8 itunesconnect issue

I am struggling to get my build uploaded to itunesconnect since upgrading to XCode8 - might have to do with the swift 3.0 syntax update?... i am new to iOS dev, having been doing it now since xcode 7.1....
I submit the through Organizer, the ipa uploads, but then i get an email from itunesconnect:
"Invalid Swift Support - The expected dylibs are missing from the app’s Framework location, such as /Payload/Health Storylines.app/Frameworks."
My app target uses obj-c, and the UItest target uses swift.
ive read: Invalid Swift Support / invalid implementation of swift
i cant find any embedded swift settings in xcode8...
ive read:Invalid Swift Support - Files don’t match
but in the .sh they want some lines commented out - it only runs on xcode version below 7...show this shouldnt matter.
ive just read http://radex.io/xcode7-xcode8/
there are some cocopoads code signing topics in here...not sure if this is relevant?
this the the contects of the .xarchive:
Im thinking swift need to be turned off somewhere, but dont know where...
Help much appreciated!
Seems like a problem that I had. Try archiving and exporting the IPA with XCode 7.x.x, and then upload it with Application Loader (XCode 8 GM). Also, what is your macOS version?
I had the same issue If you are using fastlane and swift 2.3 you may try adding toolchain "com.apple.dt.toolchain.Swift_2_3" on your Gymfile, it worked for me.

Getting the error 'GL_MAX_SAMPLES_APPLE' undeclared (first use in this function) while working with cocos 2d engine

i was working with the cocos 2d engine which i integrated in the xcode version 3.2.2.I started with the downloaded application which gave the error as 'GL_MAX_SAMPLES_APPLE' undeclared , later i tried with the blank project ,its still giving the same error.
I dont know whats wrong and where. please suggest me how to integrate cocos2d in xcode 3 and what all settings to do
thanks in advance..
In the Cocos2D v1.0 Release Notes you'll see that the minimum requirement is Xcode 3.2.6 with iOS 4.1. You said you're using Xcode 3.2.2. There's your problem, probably.
If you still want to use Xcode 3 then you can get the latest version 3.2.6 here. Personally I recommend to upgrade to Xcode 4.x for the simple reason that you can't create iOS 5 apps with Xcode 3 and Xcode 3 being incompatible with Mac OS X 10.7 Lion.
May be the file related to that is missing.
That definitely looks like a compile-type error, one generally caused simply by not having that symbol defined at the point where you want to use it.
Any number of things could be going wrong here. Here's a couple of things to check.
Are you including the correct header file (glext.h, I believe) in your sample?
Is that header file being picked up from the correct location (you may have other similarly named files in other places)?
Does that (or any other header file) even have that symbol defined?
If they do, do you have the correct defines so that you can see them (ofthen #define statements are themselves inside #ifdef ones)?

iPhone ARC & Facebook SDK

I'm getting all kinds of build errors with Facebook's SDK because my app uses ARC. I try to remove the Facebook files from the compiler to avoid this, but I get an Apple Mach-O error when I remove the Facebook.m file. If I put that back in the compile sources, I get the ARC errors.
Anyone run into this?
Do you exclude them from arc with Compiler flag
-fno-objc-arc
?
You can see a Answer here
And this is why distributing a shared library by copy and pasting files is bad. A library should be distributed as it's own Xcode projects with a static library target, so that the build setting requirements of your projects and the libraries you use can not screw up one or the other.
File a bug for the Facebook SDK here: https://github.com/facebook/facebook-ios-sdk/issues
And in the mean time add the -fno-objc-arc flag to the implementation files in the Facebook SDK. You can do this by;
Select your application target
Go to the Build Phases tab
Add for each file under the Compile Sources section.
The new SDK does not explicitly support ARC out of the box, but there is a shell scrip to build a static library that can be used within your ARC project. Just navigate to your local git repo and run
% ~/facebook-ios-sdk/scripts/build_facebook_ios_sdk_static_lib.sh
This will create the static library under the /lib/facebook-ios-sdk folder (e.g. ~/facebook-ios-sdk/lib/facebook-ios-sdk). You may then drag the facebook-ios-sdk folder into the app Xcode project to include the iOS Facebook SDK static library.
there are actually very few changes needed to make the Facebook iOS sdk compatible with ARC. I have made the changes in my code , but , I do not know who to send it back to the community, any pointers ?
here is a post I made to explain how to use it with ARC the simple way on Xcode 4.2:
http://nabtech.wordpress.com/2012/02/02/facebook-ios-sdk-and-arc/

ShareKit in Xcode 4 - lots of deprecated

I have just loaded the ShareKit files into my project (which worked nicely otherwise), and went to build and run (with no code additions as yet).
I received 11 warnings and 37 errors!
Is there something I'm missing here? The warnings are for deprecated functions in the SHK**** files.
Any ideas?
Using Xcode 4.
Thanks for any assistance,
Kolya
This fork (https://github.com/mogeneration/ShareKit) compiles/works perfectly on XCode 4/iPhone 3.2.1 Simulator, it should be good for you, besides is based on the latest oficial version :)
Try reborn ShareKit - supported by a community.
I'm using reborn ShareKit, but still get some warnings after adding the shareKit folder to my project. For some reason, when compiling the example project, there are no warnings at all. :(
For anyone that has been having problems with ShareKit with iOS5, Facebook released their own wrapper which is way more compatible because you know, Facebook did it.
https://github.com/facebook/facebook-ios-sdk

Will old source code run with SDK 4.2?

I've been working on creating my own iPhone app with source code my company gave me. This code was created with iPhone SDK 3.0. I've worked on it for over a year (I'm a designer so my coding is mostly copy and paste) and to test the app on my iPhone it says I must update my SDK to 4.2. I'm wondering will this break my app? I probably don't have the skills in xcode to upgrade my code if I am required to rewrite parts.
Thanks,
Chris
If none of the code has been deprecated, changed or even removed, chances are good it still runs fine. Most projects run, and if you have used external code (and hopefully noted where you got it from) there might be an update available for that piece of code.
Just set the deployment target to iOS 3.0 in your project settings
here some little explanation: link