Firebase crashes - FIRInstanceIDConfig

I manually added the Firebase SDK to my project. (Cannot use cocoapods due to configuration issues.)

I use the following frameworks

FirebaseCore.framework        
FirebaseInstanceID.framework
Firebasemessageing.framework

In AppDelegateI have imported the following:

#import "Firebase.h
#import <FirebaseInstanceID/FirebaseInstanceID.h>
#import <FirebaseMessaging/FirebaseMessaging.h>

If I refer to

[FIRMessaging messaging].remoteMessageDelegate = self;

I get a crash at runtime with the following error:

Error message in console:

*** Application termination due to the uncaught exception "NSInvalidArgumentException", reason: '- [__ NSCFConstantString fira_UTF32Length]:

However, if I comment on this and link to this line of code

 [[FIRInstanceID instanceID] token]

I get this error:

*** Application terminated due to an uncaught exception "NSInvalidArgumentException", reason: '- [FIRInstanceIDConfig setAllowGCMRegistrationWithoutAPNSToken:]: unrecognized selector sent to the instance

, , .

Edit

, :

  • ,
  • FirebaseAnalytics
  • FirebaseCore
  • FirebaseInstanceID
  • FirebaseMessaging
  • GoogleToolboxForMac
  • GTMSessionFetcher
  • Protobuf
  • FirebaseAppIndexing
  • WebKit
  • LocalAuthentication
  • ImageIO
  • AssetLibrary
  • CoreData​​li >
  • UIKit
  • Lib++. TBD
  • libsqlite3.tbd
  • libGoogleAnalyticsServices.a
  • libAdIdAccess.a

:

, :

    0   ???                                 0x00000001057f0a44 0x0 + 4387179076,
1   MyApp                            0x000000010050f220 main + 0,
2   libsystem_c.dylib                   0x0000000181363400 abort + 140,
3   libc++abi.dylib                     0x0000000180e2d2d4 __cxa_bad_cast + 0,
4   libc++abi.dylib                     0x0000000180e4acc0 <redacted> + 0,
5   libobjc.A.dylib                     0x0000000180e58844 <redacted> + 124,
6   libc++abi.dylib                     0x0000000180e4766c <redacted> + 16,
7   libc++abi.dylib                     0x0000000180e476dc _ZSt9terminatev + 64,
8   libobjc.A.dylib                     0x0000000180e587a0 <redacted> + 0,
9   libdispatch.dylib                   0x00000001015bd22c _dispatch_client_callout + 36,
10  libdispatch.dylib                   0x00000001015be048 dispatch_once_f + 116,
11  MyApp                            0x00000001006484d4 +[FIRInstanceID instanceID] + 56,
12  MyApp                            0x00000001000fa880 -[BBAppDelegate connectToFcm] + 52,
13  MyApp                            0x00000001000f3ac8 -[BBAppDelegate applicationDidBecomeActive:] + 356,
14  UIKit                               0x000000018835b4c0 <redacted> + 1152,
15  UIKit                               0x000000018855ec48 <redacted> + 2744,
16  UIKit                               0x0000000188573104 <redacted> + 48,
17  UIKit                               0x000000018855b7ec <redacted> + 168,
18  FrontBoardServices                  0x0000000183ff792c <redacted> + 36,
19  FrontBoardServices                  0x0000000183ff7798 <redacted> + 176,
20  FrontBoardServices                  0x0000000183ff7b40 <redacted> + 56,
21  CoreFoundation                      0x00000001823ceb5c <redacted> + 24,
22  CoreFoundation                      0x00000001823ce4a4 <redacted> + 524,
23  CoreFoundation                      0x00000001823cc0a4 <redacted> + 804,
24  CoreFoundation                      0x00000001822fa2b8 CFRunLoopRunSpecific + 444,
25  UIKit                               0x00000001883417b0 <redacted> + 608,
26  UIKit                               0x000000018833c534 UIApplicationMain + 208,
27  MyApp                            0x000000010050f2c4 main + 164,
28  libdyld.dylib                       0x00000001812dd5b8 <redacted> + 4
)
+4
1

→ (+) -ObjC enter. , .

+8

Source: https://habr.com/ru/post/1671269/


All Articles