Facebook and Parse integration unrecognized selector - ios

I'm trying to integrate a Facebook login with my Parse backend. Upon running the app, I receive
[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:]: unrecognized selector sent to class xxxxxx
on the line
PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(nil)
or
PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)
I have tried the solution here: https://developers.facebook.com/docs/ios/troubleshooting#unrecognizedselector
(adding the -ObjC flag), and have cleared Derived Data, to no avail.
I'm using Parse SDK 1.7.2, Facebook SDK 4.0.1, and the PFFacebookUtilesV4 framework.
The full error is as follows:
2015-05-03 14:22:25.742 hotPotato[49116:1453068] +[PFFacebookUtils
initializeFacebookWithApplicationLaunchOptions:]: unrecognized
selector sent to class 0x10f524048 2015-05-03 14:22:25.810
hotPotato[49116:1453068] *** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '+[PFFacebookUtils
initializeFacebookWithApplicationLaunchOptions:]: unrecognized
selector sent to class 0x10f524048'

I faced same issue.
My mistake was that I also added ParseFacebookUtils.framework in the project.
Just remove it and everything will be fine :)

Make sure that you have imported the correct frameworks into your bridging header:
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>
Also check that the needed frameworks are included in the Linked Frameworks and Libraries list under your target's General tab.
If you've added the frameworks manually, go to the Build Settings tab, and make sure that Search Paths contains the paths to the Parse and Facebook frameworks.
Mine looks something like this:
$(inherited)
$(PROJECT_DIR)/Vendor/Facebook
$(PROJECT_DIR)/Vendor/Parse
The PFFacebookUtils initialization call in the application(application:, didFinishLaunchingWithOptions:) delegate method should follow the Parse initialization method:
Parse.setApplicationId("<APP_ID>", clientKey:"<CLIENT_KEY>")
PFFacebookUtils.initializeFacebookWithLaunchOptions(launchOptions)
If you haven't done this already, I suggest that you consult Parse's own guide:
https://parse.com/docs/ios_guide#fbusers-setup/iOS

My problem was solved by making all my frameworks including my Parse ones referenced instead of copied.

Probably a little late but I solved this by using the Bolts.framework from the Facebook SDK as opposed to the Parse SDK.

Related

How to Fix Unity IOS Facebook Error on App Launch

I am integrating Facebook Login & Sharing into a game for IOS using Unity. But as soon as app launches i am getting this error
-> applicationWillResignActive()
2019-03-11 16:39:07.405809+0500[828:197716] +[NSError fbErrorWithCode:userInfo:message:underlyingError:]: unrecognized selector sent to class 0x1d2710f80
2019-03-11 16:39:07.466234+0500 [828:197716] Uncaught exception: NSInvalidArgumentException: +[NSError fbErrorWithCode:userInfo:message:underlyingError:]: unrecognized selector sent to class 0x1d2710f80
Actually I got almost same error codes in my project on Swift. So is not problem Unity, is problem connection Facebook SDK to project.
In my case, this error happened, when I try use VPN application Luna. Is seem have conflict VPN with Facebook SDK if is connected to project not correct. When VPN disabled, application and analytics worked without any problem.
For fix my problem, in "Project->Build Settings" need have parameter "Other Linker Flags" value "-ObjC".
Also I used bridge ".h" file for connect Facebook SDK to my Swift project. I had line "#import <FBSDKCoreKit/FBSDKCoreKit.h>", so I delete it from bridge. And manual added in every Swift class, what used Facebook SDK this line:
import FBSDKCoreKit
I did not have the "FBSDKCoreKit" parameter in "Other Linked Flags". Adding the package, then cleaning the build was a fix for me

Google Maps not displaying - Failed to decode tile

I'm having a hard time trying to display a GMSMapView. I'm seeing a blank map as shown below.
I've seen plenty of answers indicating API Key was not valid or Maps iOS SDK not enable in Google console. But in my case, key works on sample projects. I even created a basic project and had no issues displaying the map.
This is what I see in the console:
2018-09-28 10:54:37.946703+0200 XXXXX[53857:723015] ((null)) was false:
GMSStyledVectorMapTileService failed to decode tile [4,2,5], +[GMSx_GMPCClientVectorTileExtensionsRoot indoorBuildingMetadata]: unrecognized selector sent to class 0x10a9af638
2018-09-28 10:54:38.063481+0200 XXXXX[53857:723015] +[GMSx_GMPCClientVectorTileExtensionsRoot indoorBuildingMetadata]: unrecognized selector sent to class 0x10a9af638
2018-09-28 10:54:38.063666+0200 XXXXX[53857:723015] ((null)) was false: GMSStyledVectorMapTileService failed to decode tile [3,1,3], +[GMSx_GMPCClientVectorTileExtensionsRoot indoorBuildingMetadata]: unrecognized selector sent to class 0x10a9af638
Please help, I'm dying here
Ok so it's was kind of specific to my project. Google maps pod was shared among several target of my workspace project. It looks like the key wasn't shared among targets. Now maps pod is only used on main target and it's working fine.
This is either linkage problem or the Google Maps resources bundle is misplaced.
Make sure you are linking the 3 GoogleMaps frameworks correctly and only once. In our case, the problem was only reproducible in release mode and the reason was that we were linking GoogleMapsUtils with GoogleMaps frameworks AND linking the app again with GoogleMaps frameworks.
Also we had moved the GoogleMaps.bundle out of the framework and into our own framework, which was also probably a mistake.
Hope it helps.
I handled it by integrating google maps manually. I still didn't find a fix by using cocoapods.

Firebase runtime crash

I have added the Firebase SDK manually to my project (can't use cocoapods due to configuration issues).
Using the following frameworks:
FirebaseCore.framework
FirebaseInstanceID.framework
Firebasemessageing.framework
In the AppDelegate I have imported this following:
#import "Firebase.h
#import <FirebaseInstanceID/FirebaseInstanceID.h>
#import <FirebaseMessaging/FirebaseMessaging.h>
And then I reference the API:
[FIRApp configure];
All is fine when I build the project. However as soon as the app hits the Firebase SDK API - I am getting the following crash:
Error message in the console:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSData gtm_dataByGzippingData:error:]: unrecognized selector sent to class 0x10553f168'
I have added all the required frameworks I can think of, yet still getting this issue.
Make sure you've added the GoogleToolboxForMac library to your project and you've added -ObjC to Other Linker Options in Build Settings.

Parse and Facebook SDK - unrecognized selector sent to class

I'm currently using the latest Facebook SDK, Parse SDK and Xcode.
The Parse SDK frameworks were copied to my project while the Facebook SDK frameworks were referenced. I'm using Bolts.framework that was provided by Facebook and I connected my Parse account with my Facebook App.
The problem is when I try to implement Inside my AppDelegate.m file (after the Parse setApplicationId of course):
[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:launchOptions];
my app crashes with the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:]: unrecognized selector sent to class 0x102c060b0'
These are the header files I included:
#import <Parse/Parse.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>
When I'm using the normal Facebook SDK alone it works fine - I can login using Facebook login button. When Parse comes into play with it's PFFacebookUtils class, I just had horrible experience. At first I couldn't even build the project because of linker errors which were fixed using this solution:
https://stackoverflow.com/a/18626232/3608136
I've tried every solution in Stackoverflow, but I can't figure it out. Here is how my "Search Paths" look:
$(inherited)
$(PROJECT_DIR)/parse-library-1
/Users/me/Documents/FacebookSDK
Everything related to Parse is in parse-library-1.
By the way, needless to say.. when I try to user other methods like logInInBackgroundWithReadPermissions it crashes.
You can try to add "-ObjC" flag to Other Linker Flags section in project settings.
Its happens to me with another framework and the solution was that!
I hope it helps!

Urban Airship crashes when calling takeoff

Upgrading to UrbanAirship 3.0.0 with Xcode 5.0, I'm getting an error when calling this code:
[UAirship takeOff:config];
The error is
+[NSJSONSerialization stringWithObject:]: unrecognized selector sent to class 0x3b2ca9fc
2013-09-19 15:02:31.981 [178:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSJSONSerialization stringWithObject:]: unrecognized selector sent to class 0x3b2ca9fc'
This doesn't seem to appear when setting the key "inProduction" to "YES" in the AirshipConfig.plist, which makes sense as calling takeOff: populates the instance of UAirShip.
It seems to be due to the category NSJSONSerialization+UAAdditions.
Any help on this one?
Thanks
To fix this issue, you must include "-ObjC" flag in "Other Linker Flags" found in your projects build settings.
UAirship library 3.x now makes use of Objective-C categories so this flag must be set to avoid the runtime exception.
Details on the issue can be found here:
https://developer.apple.com/library/mac/qa/qa1490/_index.html
Updated the docs:
http://docs.urbanairship.com/build/ios.html#build-settings
http://docs.urbanairship.com/topic_guides/ios_migration.html#linker-flags
Doesn't seam to be happening with the source: https://github.com/urbanairship/ios-library
You must have included both the libraries:
libUAirship-3.0.0.a
libUAirship-iOS5-3.0.0.a
You have to use either of the library for respective iOS
After looking at different solutions, it turns out that this fixes the issue:
• Download sources from https://github.com/urbanairship/ios-library directly into your App folder (don't take .zip given on their website)
• Drag & drop the Airship folder in your Project (do not use the AirshipLib one)
• Don't link any of the libUAirship-3.0.0.a or libUAirship-iOS5-3.0.0.a
• Boom. It's working.
Hope it'll help some others out there looking to fix this for ages.
Just to add, my problem was that I added -ObjC flag to the project, and it should be added to the target settings.
Also, if that does not compile, there is another option
-Wl,-force_load,<PathToYourLib>/libUAirship-4.0.0.a
Also should be added to the target. Fill the real path to your lib instead of <PathToYourLib>.

Resources