iOS, Error when initializing GMSPlacesClient - unrecognized selector sent to instance - ios

I am trying to integrate Google Maps API's Autocomplete feature on the app.
I am trying to instantiate GMSPlacesClient on the a ViewController's viewDidLoad override, according to the documentation here.
https://developers.google.com/places/ios-api/start
var placesClient: GMSPlacesClient?
override func viewDidLoad() {
placesClient = GMSPlacesClient()
super.viewDidLoad()
}
GMSServices has been instantiated on the AppDelegate using my key.
But I'm getting the following error during instantiation.
2015-10-02 22:04:59.734 food2eat[93509:13849667] -[NSThread gtm_performBlock:]: unrecognized selector sent to instance 0x7ffc03f04f80
2015-10-02 22:04:59.766 food2eat[93509:13849667] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSThread gtm_performBlock:]: unrecognized selector sent to instance 0x7ffc03f04f80'
What am I doing wrong?

Faced the same problem. This error started after I changed the GMS API key.

Oh I figured it out alright! I remembered that It worked for me while not using CocoaPods.
I specifically remember that I needed to add a bunch of frameworks, but the important thing here is that you have to add the -ObjC flag, to the Other Linker Flags in your target's Build Settings.
After doing that it worked for me!

Related

ios Chromecast sender: [NSMutableDictionary gck_loadFromCacheWithName:]: unrecognized selector sent to class 0x1133f1678

Im trying to build a chromecast sender app for ios. I am running the HelloVideoGoogleCast successfully. Now mimicking that, I use these lines in my app:
// Chromecast added section:
kReceiverAppID= #"65E5F27B"; // the app code
// Establish filter criteria.
GCKFilterCriteria *filterCriteria = [GCKFilterCriteria
criteriaForAvailableApplicationWithID:kReceiverAppID];
// Initialize device scanner.
self.deviceScanner = [[GCKDeviceScanner alloc] initWithFilterCriteria:filterCriteria];
and I get the following error on the last line:
[NSMutableDictionary gck_loadFromCacheWithName:]: unrecognized selector sent to class 0x1133f1678
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSMutableDictionary gck_loadFromCacheWithName:]: unrecognized selector sent to class 0x1133f1678'
You need to add the -ObjC linker flag to your Other Linker Flags entry in the Build Settings part of XCode.
Those categories should then be loaded from the static library once that's in, and you'll be good to go!
As an alternative, consider using Cocoapods to integrate the google-cast-sdk, which will do this for you!

Quckiblox ios SDK crashes on all API calls

I am developing an app using Quckiblox (Swift 2, iOS 9) and all attempts to make an API call produce the following error:
2015-10-04 04:46:06.411 Twister[1964:846268] +[QBRequest signUp:successBlock:errorBlock:]: unrecognized selector sent to class 0x1000f7358
2015-10-04 04:46:06.415 Twister[1964:846268] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[QBRequest signUp:successBlock:errorBlock:]: unrecognized selector sent to class 0x1000f7358'
The SDK was installed with Cocoapods and it's being set up like:
func setup() {
print("Setting up Quickblox...")
QBApplication.sharedApplication().applicationId = UInt(AppConfiguration.Quickblox.ApplicationID.description)!
QBConnection.registerServiceKey(AppConfiguration.Quickblox.AuthorizationKey.description)
QBConnection.registerServiceSecret(AppConfiguration.Quickblox.AuthorizationSecret.description)
QBSettings.setAccountKey(AppConfiguration.Quickblox.AccountKey.description)
}
This is the faulty call:
QBRequest.signUp(user, successBlock: { response, user -> Void in
print("Sign up successfull:\n \(user)")
})
{ response -> Void in
print(response.error)
}
Any ideas on what might be wrong?
Make sure you have opened xcworkspace and NOT xcodeproj.
I have tested your code and everything works, so problem is that Xcode can not find .framework symbols, it finds only headers
May be this is late but it may help someone in future
i have faced same problem and that was solved by
Add -lxml2, -ObjC flags to Other Linker Flags section in project settings
Official doc link
If still error occurs check if any framework is missing

Error when running Firebase in Swift

I am playing around with Firebase and I am trying to print the value of an item in Swift. This is the only code in the whole application, so nothing really complicated is going on.
var myRootRef = Firebase(url:"https://jotty.firebaseio.com/")
override func viewDidLoad() {
super.viewDidLoad()
myRootRef.observeEventType(.Value, withBlock: {
snapshot in
println(snapshot.value)
})
}
When I run this I get an error:
2015-07-15 12:15:03.492 Jotty[32431:733653] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FRepo youForgotToSetMinusObjCInTheOtherLinkerFlagsInYourXCodeProject]: unrecognized selector sent to instance 0x7b28b7a0'
Would anyone know how to fix this? I have been trying to fix this all day but I have no idea what is wrong with the application.
In "Build Settings" under "Other Linker Flags" use the "-ObjC" flag.
I recommend using CocoaPods instead of a manual setup.
See the Firebase docs for a manual setup.

unrecognized selector "fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler:" in GG Cloud Messaging

I try to implement cloud messaging, and I'm facing with a problem, It makes my game terminate. But I don't have this problem with example project.
The relating class's GGLInstanceIDTokenManager, It's a private class in libGGLInstanceIDLib.a lib. The below is what I see on xCode log:
2015-06-16 18:13:04.446 BreezeGame[2307:427893] -[GGLInstanceIDTokenManager fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler:]: unrecognized selector sent to instance 0x14681290
2015-06-16 18:13:04.713 BreezeGame[2307:427893] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GGLInstanceIDTokenManager fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler:]: unrecognized selector sent to instance 0x14681290'
Why didn't Xcode find fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler: function ?
Please help me to fix it. I'm newbie with Cloud Messaging.
I just ran nm on the library and apparently there is an Internal category on GGLInstanceIDTokenManager which does declare this function,
libGGLInstanceIDLib.a(GGLInstanceIDTokenManager+Internal.o): 00001230
t -[GGLInstanceIDTokenManager(Internal)
deleteRegisteredTokenWithAuthorizedEntity:scope:keyPair:handler:]
000029cc s -[GGLInstanceIDTokenManager(Internal)
deleteRegisteredTokenWithAuthorizedEntity:scope:keyPair:handler:].eh
00000230 t -[GGLInstanceIDTokenManager(Internal)
fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler:]
00002894 s -[GGLInstanceIDTokenManager(Internal)
fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler:].eh
Not sure why it doesn't work for you. Maybe you should file a bug on gcm's github tracker.
My problem was that the bundle id of my app was not the same as the one in GoogleService-Info.plist

Integration and Use of W3i iOS Advertiser SDK to advertise our iOS app

I'm integrating W3i Advertiser SDK in iOS app, but app is being crashed at following line.
[[W3iAdvertiserSdk sharedConnector] connectWithAppID:W3I_APP_ID];
and here is exception:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryI W3iPublisherJSONRepresentation]: unrecognized selector sent to instance 0xa1d7520'
*** First throw call stack:
(0x29d3012 0x23fae7e 0x2a5e4bd 0x29c2bbc 0x29c294e 0x16af7a 0x3e25 0xcd57b7 0xcd5da7 0xcd6fab 0xce8315 0xce924b 0xcdacf8 0x2903df9 0x2903ad0 0x2948bf5 0x2948962 0x2979bb6 0x2978f44 0x2978e1b 0xcd67da 0xcd865c 0x2d08d 0x26c5)
libc++abi.dylib: terminate called throwing an exception
I Searched a lot but there is no information on net related to w3i's integration and it's use except w3i's official guideline.
https://associate.w3i.com/integration/W3i_iOS_Advertiser_SDK_Integration_Guide1.htm
https://associate.w3i.com/integration/index.html
Here are steps i'm following:
Step1: Download SDK from W3i
Step2: Drag W3iAdvertiserSdk-3.2.0 folder into project's file folder
Step3 Add a link to the following frameworks if not already present:
AdSupport.framework
UIKit.framework
Foundation.framework
CoreGraphics.framework
Step4: Add to your AppDelegate.m file, #import "W3iAdvertiserSdk.h"
If I run the app after above Integration then app runs fine without any error but when i call the method of W3iAdvertiser to connect with app then it it throws exception which i've already posted above.
// add this line to application's didFinishLaunchingWithOptions method
[[W3iAdvertiserSdk sharedConnector] connectWithAppID:W3I_APP_ID]; //appId created at w3i
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryI W3iPublisherJSONRepresentation]: unrecognized selector sent to instance 0xa1d7520'
*** First throw call stack:
(0x29d3012 0x23fae7e 0x2a5e4bd 0x29c2bbc 0x29c294e 0x16af7a 0x3e25 0xcd57b7 0xcd5da7 0xcd6fab 0xce8315 0xce924b 0xcdacf8 0x2903df9 0x2903ad0 0x2948bf5 0x2948962 0x2979bb6 0x2978f44 0x2978e1b 0xcd67da 0xcd865c 0x2d08d 0x26c5)
libc++abi.dylib: terminate called throwing an exception
Can anyone please guide me where i'm going wrong, how to use SDK's functions to connect App with w3i's to advertise our app through w3i ?
You need to follow this step as well:
Add -ObjC to Other Linker Flags in your target's Build Settings. That will allow "Option 1" to not crash.
There are two ways to connect app with w3i:
Option1: Integrate W3i-iOS-SDK, and call it's method "connectWithAppId" at start of application.
Option2: Call W3i "appWasRun" API at start of application
first option didn't work for me, but Option2 is quite easy and working fine.
Here is format of API and it's parameters:
http://api.w3i.com/PublicServices/MobileTrackingApiRestV1.svc/AppWasRun?AppId={APPID}&clientIp={CLIENTIP}&iOSIDFA={advertisingIdentifier}&iOSUDID={IOSUDID}&iOSOpenUDID={IOSOpenUDID}&iOSMD5WLANMAC={iOSMD5WLANMAC}&iOSSha1HashedMac={iOSSha1HashedMac}
Request Type: GET
Required Parameters: APPID (generated by W3I) and at-least one identifier (all parameters are preferred by W3i)
I used only OpenUDID and it worked fine.
http://api.w3i.com/PublicServices/MobileTrackingApiRestV1.svc/AppWasRun?AppId=W3i_APP_ID&iOSOpenUDID=OPEN_UDID
For More Information check the following links.
https://sites.google.com/site/w3ideveloperscom/ios/iOSAFPP/advapi
https://associate.w3i.com/integration/Device_Identifiers.htm
Hope it would help others in future :)

Resources