How to Fix Unity IOS Facebook Error on App Launch - ios

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

Related

GADInvalidInitializationException without Installing GoogleMobileAds SDK iOS

I am building a react-native app which I do not intend to display ads but I have Firebase Authentication and other related services. To my surprise I keep getting this error below. What could have happen?
*** Terminating app due to uncaught exception
'GADInvalidInitializationException', reason: 'The Google Mobile Ads SDK
was initialized incorrectly. Google AdMob publishers should follow
instructions here: https://googlemobileadssdk.page.link/admob-ios-
update-plist to include the AppMeasurement framework, set the -ObjC
linker flag, and set GADApplicationIdentifier with a valid App ID.
Google Ad Manager publishers should follow instructions here:
https://googlemobileadssdk.page.link/ad-manager-ios-update-plist'
The way I found around this error is to update the info.plist by adding
<key>GADIsAdManagerApp</key>
<true/>
This solved the error issue but not the fundamental problem which is why should it required GAD Application Identifier since ads will not be displayed in the app.

NSInvalidArgumentException using Vungle when Unity app starts

I built a Unity project using Vungle ads and when I build the project for iOS and try to run I get a NSInvalidArgumentException in a Vungle Network Manager call. Does anybody know how to solve this?
This is the error:
Uncaught exception: NSInvalidArgumentException: -[VNGNetworkManager configOperationWithBackgroundInit:complete:]: unrecognized selector sent to instance 0x129ee6110
Turns out it was a bug with the Vungle lib.
Adding GameController.framework to General -> Linked Frameworks and Libraries and -ObjC flag to Build Settings -> Linking -> Other linker flags fixed the problem.

On Google plus integration in iOS app crashes

i am trying to implement google plus login but app crashes and get the following error
+[NSBundle gpp_registerFonts]: unrecognized selector sent to class 0x34ce2f0c
Ensure that uou have added -ObjC to Other Linker Flags in the build settings of your app.

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>.

Admob Ads on iOS 4.3 Error-GADObjectPrivate

I am getting the following error on a new app:
'NSInvalidArgumentException', reason: '-[GADObjectPrivate
changeState:]: unrecognized selector sent to instance 0x1ed49a90'.
I have a couple ad networks-Chartboost and Admob. This seems like an Admob error, but it is causing the app to terminate on launch. I have removed the admob code and files, and I am still getting the error.
I don't know if this helps anyone:
* First throw call stack: (0x374ca2a3 0x34fca97f 0x374cde07 0x374cc531 0x37423f68 0x9e950 0xa0314 0x9deb0 0x6e147 0x36e53595
0x36e93d79 0x36e8faed 0x36ed11d1 0x6de0d 0x36e94ad9 0x36e94663
0x36e8c84b 0x36e34c41 0x36e346d5 0x36e34123 0x350c75a3 0x3749f683
0x3749eee9 0x3749dcb7 0x37410ebd 0x37410d49 0x36e8b485 0x36e88301
0x6db2d 0x6da90) libc++abi.dylib: terminate called throwing an
exception
Which version of AdMob are you using? If you are using v6.2, you must use the -ObjC linker flag in the "Other Linker Flags" section of Build Settings. If you are using v6.1 or below, you have to use the -all_load linker flag.
Also, if you're using v6.2, you must be using XCode 4.5 and targeting iOS 6 (you can set your minimum deployment target to iOS 4.3 though).

Resources