title: Firebase runtime crash - FIRInstanceIDConfig
body: <p>I have added the Firebase SDK manually to my project. (Can't use cocoapods due to configuration issues.) </p>
  
  <p>I use the following frameworks </p>
  
  <pre><code>FirebaseCore.framework        
  FirebaseInstanceID.framework
  Firebasemessageing.framework
  </code></pre>
  
  <p>In the <code>AppDelegate</code> I have imported the following: </p>
  
  <pre><code>#import "Firebase.h
  #import &lt;FirebaseInstanceID/FirebaseInstanceID.h&gt;
  #import &lt;FirebaseMessaging/FirebaseMessaging.h&gt;
  </code></pre>
  
  <p>If I make reference to </p>
  
  <pre><code>[FIRMessaging messaging].remoteMessageDelegate = self;
  </code></pre>
  
  <p>I get a runtime crash with the following error: </p>
  
  <p><strong>Error message in the console:</strong></p>
  
  <blockquote>
    <p>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString
    fira_UTF32Length]:</p>
  </blockquote>
  
  <p>However if I comment out that and make reference to this line of code</p>
  
  <pre><code> [[FIRInstanceID instanceID] token]
  </code></pre>
  
  <p>I get this error: </p>
  
  <blockquote>
    <p>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FIRInstanceIDConfig setAllowGCMRegistrationWithoutAPNSToken:]: unrecognized selector sent to instance </p>
  </blockquote>
  
  <p>I have added all the required frameworks I can think of, yet still getting this issue. </p>
  
  <p><strong>Edit</strong></p>
  
  <p>The complete list of Frameworks linked to the project: </p>
  
  <ul>
  <li>Fabric, </li>
  <li>FirebaseAnalytics</li>
  <li>FirebaseCore</li>
  <li>FirebaseInstanceID</li>
  <li>FirebaseMessaging</li>
  <li>GoogleToolboxForMac</li>
  <li>GTMSessionFetcher</li>
  <li>Protobuf</li>
  <li>FirebaseAppIndexing</li>
  <li>WebKit</li>
  <li>LocalAuthentication</li>
  <li>Security</li>
  <li>ImageIO</li>
  <li>AssetLibrary</li>
  <li>CoreData</li>
  <li>UIKit</li>
  <li>libc++.tbd</li>
  <li>libsqlite3.tbd</li>
  <li>libGoogleAnalyticsServices.a</li>
  <li>libAdidAccess.a</li>
  </ul>
  
  <p><strong>The stack trace:</strong> </p>
  
  <p>This is the thread where it crashes is: </p>
  
  <pre><code>    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 &lt;redacted&gt; + 0,
  5   libobjc.A.dylib                     0x0000000180e58844 &lt;redacted&gt; + 124,
  6   libc++abi.dylib                     0x0000000180e4766c &lt;redacted&gt; + 16,
  7   libc++abi.dylib                     0x0000000180e476dc _ZSt9terminatev + 64,
  8   libobjc.A.dylib                     0x0000000180e587a0 &lt;redacted&gt; + 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 &lt;redacted&gt; + 1152,
  15  UIKit                               0x000000018855ec48 &lt;redacted&gt; + 2744,
  16  UIKit                               0x0000000188573104 &lt;redacted&gt; + 48,
  17  UIKit                               0x000000018855b7ec &lt;redacted&gt; + 168,
  18  FrontBoardServices                  0x0000000183ff792c &lt;redacted&gt; + 36,
  19  FrontBoardServices                  0x0000000183ff7798 &lt;redacted&gt; + 176,
  20  FrontBoardServices                  0x0000000183ff7b40 &lt;redacted&gt; + 56,
  21  CoreFoundation                      0x00000001823ceb5c &lt;redacted&gt; + 24,
  22  CoreFoundation                      0x00000001823ce4a4 &lt;redacted&gt; + 524,
  23  CoreFoundation                      0x00000001823cc0a4 &lt;redacted&gt; + 804,
  24  CoreFoundation                      0x00000001822fa2b8 CFRunLoopRunSpecific + 444,
  25  UIKit                               0x00000001883417b0 &lt;redacted&gt; + 608,
  26  UIKit                               0x000000018833c534 UIApplicationMain + 208,
  27  MyApp                            0x000000010050f2c4 main + 164,
  28  libdyld.dylib                       0x00000001812dd5b8 &lt;redacted&gt; + 4
  )
  </code></pre>