I am using intel multi-os-engine to build my iOS-app. When trying to setup Firebase Messaging I get the following error:
* Assertion failure in -FIRMessaging teardown, /Users/hpbaxxter/StudioProjects/app/ios/xcode/Pods/FirebaseMessaging/Firebase/Messaging/FIRMessaging.m:374
2019-01-24 15:13:15.988333+0100 SkipAndGo[4195:75192] * Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'FIRMessaging should be
called from main thread only.'
*** First throw call stack: ( 0 CoreFoundation 0x00000000177921bb __exceptionPreprocess + 331 1 libobjc.A.dylib
0x0000000016d30735 objc_exception_throw + 48 2 CoreFoundation
0x0000000017791f42 +[NSException raise:format:arguments:] + 98 3
Foundation 0x0000000013de9940
-[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166 4
SkipAndGo 0x000000000b5b512a -[FIRMessaging
teardown] + 234 5 SkipAndGo
0x000000000b5b3da3 -[FIRMessaging dealloc] + 195 6 libobjc.A.dylib
0x0000000016d42dcc _ZN11objc_object17sidetable_releaseEb + 202 7
??? 0x0000000044f6ec79 0x0 +
1157033081 ) libc++abi.dylib: terminating with uncaught exception of
type NSException
I already read Q&A's like this one here.
This is my Code when setting up FIRMessaging:
Globals.dispatch_async(Globals.dispatch_get_main_queue(), new Globals.Block_dispatch_async() {
#Override
public void call_dispatch_async() {
FIRMessaging.alloc().setDelegate(CLOUDMESSAGES_DELEGTE);
application.registerForRemoteNotifications();
}
}
);
You should use the class method messaging to get the instance. Looks like you are creating a new instance instead of using the messaging() method.
This method return what you want.
/**
* FIRMessaging
*
* #return An instance of FIRMessaging.
*/
+ (instancetype)messaging NS_SWIFT_NAME(messaging());
Related
I am getting a '-[_SwiftValue mergeType]: unrecognized selector sent to instance' error whenever I try to save a managed object context after doing a delete or an update of a record. For example:
context.delete(managedObject)
follow by
context.save()
and yes, context.save() is in a do-try-catch.
Records insert just fine, but the delete is throwing an exception. Stack trace is as follows:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_SwiftValue mergeType]: unrecognized selector sent to instance 0x60800005b0f0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010afac34b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010a5f021e objc_exception_throw + 48
2 CoreFoundation 0x000000010b01bf34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010af31c15 ___forwarding___ + 1013
4 CoreFoundation 0x000000010af31798 _CF_forwarding_prep_0 + 120
5 CoreData 0x000000010aae203a -[NSManagedObjectContext(_NSInternalAdditions) _validateObjects:forOperation:error:exhaustive:forSave:] + 1946
6 CoreData 0x000000010aae1836 -[NSManagedObjectContext(_NSInternalAdditions) _validateChangesForSave:] + 422
7 CoreData 0x000000010aae1476 -[NSManagedObjectContext(_NSInternalChangeProcessing) _prepareForPushChanges:] + 214
8 CoreData 0x000000010aaddeb2 -[NSManagedObjectContext save:] + 562
Trace starts right after it leaves my code.
Any insight would be helpful.
You may get this error when you use code like this, to set a merge policy:
context.mergePolicy = NSMergePolicyType.mergeByPropertyStoreTrumpMergePolicyType
Instead use this:
context.mergePolicy = NSMergePolicy(merge: .mergeByPropertyStoreTrumpMergePolicyType)
I have an NSTimer that calls the checkStatus function every 2 seconds:
-(void) checkStatus
{
#autoreleasepool
{
self.lblconnectionStatus.backgroundColor=RGB(0,153,0);
}
}
The app crashes on: self.lblconnectionStatus.backgroundColor=RGB(0,153,0);
Here is the error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(
0 CoreFoundation 0x02244466 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x01af5a97 objc_exception_throw + 44
2 CoreFoundation 0x020fb5a1 -[__NSArrayM insertObject:atIndex:] + 881
3 CoreFoundation 0x020fb201 -[__NSArrayM addObject:] + 65
4 UIKit 0x00ad559c PushNextClassForSettingIMP + 383
5 UIKit 0x00acce56 TaggingAppearanceObjectSetterIMP + 50
6 GIG-iPad 0x0017ddcb -[TradeController checkStatus] + 763
7 Foundation 0x016f6607 -[NSThread main] + 76
8 Foundation 0x016f6560 __NSThread__main__ + 1326
9 libsystem_pthread.dylib 0x02e20ecf _pthread_body + 138
10 libsystem_pthread.dylib 0x02e20e45 _pthread_body + 0
11 libsystem_pthread.dylib 0x02e1ef0e thread_start + 34
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Maybe "checkStatus" function have like,
[xxxx addObject:yyy];
Problem is yyy is nil so, Try this.
if (yyy != nil) {
[xxxx addObject:yyy];
}
I am having an unrecognized selector sent to instance issue. I know which line I am having problem with, but I don't understand why it doesn't recognize it. (I tested this code in when I was creating my container views and it works just fine. But for some reason when I merge it to my main project I am getting this error.)
This is my console output:
2013-12-20 16:47:59.633[8545:70b] -[UIViewController decideViewController:]: unrecognized selector sent to instance 0x8b5c250
2013-12-20 16:47:59.659[8545:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController decideViewController:]: unrecognized selector sent to instance 0x8b5c250'
*** First throw call stack:
(
0 CoreFoundation 0x01c075e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0198a8b6 objc_exception_throw + 44
2 CoreFoundation 0x01ca4903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x01bf790b ___forwarding___ + 1019
4 CoreFoundation 0x01bf74ee _CF_forwarding_prep_0 + 14
5 TProduct 0x0000566f -[GameViewController changeViews:] + 143
6 TProduct 0x00005404 -[GameViewController timerTick:] + 532
7 Foundation 0x015c1927 __NSFireTimer + 97
8 CoreFoundation 0x01bc5bd6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
9 CoreFoundation 0x01bc55bd __CFRunLoopDoTimer + 1181
10 CoreFoundation 0x01bad628 __CFRunLoopRun + 1816
11 CoreFoundation 0x01bacac3 CFRunLoopRunSpecific + 467
12 CoreFoundation 0x01bac8db CFRunLoopRunInMode + 123
13 GraphicsServices 0x0387b9e2 GSEventRunModal + 192
14 GraphicsServices 0x0387b809 GSEventRun + 104
15 UIKit 0x006f8d3b UIApplicationMain + 1225
16 TProduct 0x000070fd main + 141
17 libdyld.dylib 0x0224570d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
and this is the part that it doesn't recognize
GameViewController.m
-(void)changeViews:(NSString *)gameStateSegueIdentifier
{
NSLog(#"show view gameStateSegueIdentifier :%#",gameStateSegueIdentifier);
[self.containerController decideViewController:gameStateSegueIdentifier];
}
and this is the method I am calling
ContainerViewController.m
-(void)decideViewController:(NSString *)gameStateSegueIdentifier
{
if (gameStateSegueIdentifier == _currentSegueIdentifier) {
return;
}
while (gameStateSegueIdentifier != _currentSegueIdentifier) {
NSLog(#"this is the gameStateSegueIdentifier %#",gameStateSegueIdentifier);
NSLog(#"this is the currentSegueIdentifier %#",_currentSegueIdentifier);
[self changeViewControllers];
}
}
I understand that there are lots of "unrecognized selector sent to instance" questions already. But so far, I wasn't able to find an answer for my case. I appreciate the help.
The error message you're getting explains the problem:
2013-12-20 16:47:59.633[8545:70b] -[UIViewController decideViewController:]: unrecognized selector sent to instance 0x8b5c250
This is telling you that an instance of the class UIViewController got the message decideViewController:. UIViewController does not respond to this message. So, it seems that self.containerController is a UIViewController rather than a ContainerViewController. (If it was a ContainerViewController, it would say so in the error message.)
The fact that the property is declared as a ContainerViewController doesn't mean that there's actually a ContainerViewController in it. Go to where you actually create this object and assign it to that property, and ensure you're creating it as the correct class.
when the selector is not recognized you don't need to show the code for the selector, because it is not executed.
Show the property line of containerController.
Are you 100% sure that self.containerController is a ContainerViewController, your error message shows a UIViewController, so you are doing something special like cluster or a category?
Are you using #import "ContainerViewController"?
Is the method in the #implementation #end part?
I'm trying to start an application with some native jogl libraries under mac. It runs on linux and windows. The error message is:
2012-10-26 16:35:49.160 java[1440:1703] invalid drawable
2012-10-26 16:35:49.163 java[1440:1703] -[NSView CGLPBufferObj]: unrecognized selector sent to instance 0x7fc73d201960
2012-10-26 16:35:49.164 java[1440:1703] Apple AWT Internal Exception: -[NSView CGLPBufferObj]: unrecognized selector sent to instance 0x7fc73d201960
2012-10-26 16:35:49.165 java[1440:1703] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSView CGLPBufferObj]: unrecognized selector sent to instance 0x7fc73d201960'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff929e60a6 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8f7533f0 objc_exception_throw + 43
2 CoreFoundation 0x00007fff92a7c6ea -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
3 CoreFoundation 0x00007fff929d45ce ___forwarding___ + 414
4 CoreFoundation 0x00007fff929d43b8 _CF_forwarding_prep_0 + 232
5 AppKit 0x00007fff8c6395be -[NSOpenGLContext setPixelBuffer:cubeMapFace:mipMapLevel:currentVirtualScreen:] + 59
6 libjogl_desktop.jnilib 0x00000001284708cb setContextPBuffer + 203
7 libjogl_desktop.jnilib 0x00000001284d428b Java_jogamp_opengl_macosx_cgl_CGL_setContextPBuffer__JJ + 43
8 ??? 0x000000010790ef90 0x0 + 4421906320
)
libc++abi.dylib: terminate called throwing an exception
Process finished with exit code 134
Any idea?
i try to trace the route between two points in my iPhone application using cloudmade, the application crashes and i got this report :
2011-06-23 17:07:56.153 TopStation[1307:9b03] +[NSArray arrayWithContentsOfURL:headers:]: unrecognized selector sent to class 0x2bdb4c4
2011-06-23 17:07:56.154 TopStation[1307:9b03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSArray arrayWithContentsOfURL:headers:]: unrecognized selector sent to class 0x2bdb4c4'
*** Call stack at first throw:
(
0 CoreFoundation 0x02b79919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0298e5de objc_exception_throw + 47
2 CoreFoundation 0x02b7b4eb +[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x02aeb116 ___forwarding___ + 966
4 CoreFoundation 0x02aeacd2 _CF_forwarding_prep_0 + 50
5 TopStation 0x00072bbf -[CMRoutingManager findRouteFrom:] + 580
6 Foundation 0x0012f2a8 -[NSThread main] + 81
7 Foundation 0x0012f234 __NSThread__main__ + 1387
8 libSystem.B.dylib 0x910aa7fd _pthread_start + 345
9 libSystem.B.dylib 0x910aa682 thread_start + 34
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
Data Formatters unavailable (Error calling dlopen for: "/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib": "dlopen(/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib, 10): no suitable image found. Did find:
/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib: out of address space")
(gdb)
My code is as below :
- (void)viewDidLoad {
[super viewDidLoad];
[RMMapView class];
TokenManager* tokenManager = [[TokenManager alloc] initWithApikey:#"a53b3323702f42fc8486e24df34f9ac3"];
_routingManager = [[CMRoutingManager alloc] initWithMapView:mapView tokenManager:tokenManager];
_routingManager.delegate = self;
CLLocationCoordinate2D from;
from.latitude= 53.358311;
from.longitude=-6.481934;
CLLocationCoordinate2D to;
to.latitude=52.657616;
to.longitude=-8.635254;
CMRoutingVehicle transport = CMVehicleCar;//CMVehicleWalking or CMVehicleBike
[_routingManager findRouteFrom:from to:to onVehicle:transport];
}
Any help will be appreciated :)
This exception
2011-06-23 17:07:56.154 TopStation[1307:9b03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSArray arrayWithContentsOfURL:headers:]: unrecognized selector sent to class 0x2bdb4c4'
says, that you are sending a message to an class, that doesnt have the method, that fits to it. +[NSArray arrayWithContentsOfURL:headers:]
my guess: You are not importing a Category on NSArray, that declares and implements +arrayWithContentsOfURL:headers:
And make sure you added the linker flags -ObjC
-all_load