title: React Native app crashes when calling .getToken() on @react-native-firebase/messaging
body: <p>I am a developing a bare react native app with <strong>react native cli</strong>.</p>
  <p>I recentlty integrated firebase and installed <strong>@react-native-firebase/messaging.</strong></p>
  <p>When calling <strong>.getToken() of messaging</strong></p>
  <pre><code>import messaging from '@react-native-firebase/messaging';
  await messaging().getToken() &lt;------------ CAUSING APP TO CLOSE
  </code></pre>
  <p>Everytime I add this line the app closes without any warnings and logs, It dosen't happen when I comment the line</p>
  <p><strong>Here's my AndroidManifest.XML</strong></p>
  <pre><code>&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  package=&quot;com.NAME.NAME&quot;&gt;
  
  &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;
  &lt;uses-permission android:name=&quot;android.permission.RECEIVE_BOOT_COMPLETED&quot;/&gt;
  &lt;application
    android:name=&quot;.MainApplication&quot;
    android:label=&quot;@string/app_name&quot;
    android:icon=&quot;@mipmap/ic_launcher&quot;
    android:roundIcon=&quot;@mipmap/ic_launcher_round&quot;
    android:allowBackup=&quot;false&quot;
    android:theme=&quot;@style/AppTheme&quot;&gt;
  
    &lt;activity
      android:name=&quot;.MainActivity&quot;
      android:label=&quot;@string/app_name&quot;
      android:configChanges=&quot;keyboard|keyboardHidden|orientation|screenSize|uiMode&quot;
      android:launchMode=&quot;singleTask&quot;
      android:windowSoftInputMode=&quot;adjustResize&quot;&gt;
      &lt;intent-filter&gt;
          &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
          &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
      &lt;/intent-filter&gt;
    &lt;/activity&gt;
          &lt;meta-data
          android:name=&quot;com.google.android.gms.ads.APPLICATION_ID&quot;
          android:value=&quot;ca-app-pub-9772207663610474XXXXXXXXXX&quot;/&gt;
    &lt;meta-data 
          android:name=&quot;com.dieam.reactnativepushnotification.notification_foreground&quot;
          android:value=&quot;false&quot;/&gt;
      &lt;!-- Change the resource name to your App's accent color - or any other color you want --&gt;
    &lt;meta-data  
          android:name=&quot;com.dieam.reactnativepushnotification.notification_color&quot;
          android:resource=&quot;@color/white&quot;/&gt; &lt;!-- or @android:color/{name} to use a standard color --&gt;
                  &lt;receiver android:name=&quot;com.dieam.reactnativepushnotification.modules.RNPushNotificationActions&quot; /&gt;
      &lt;receiver android:name=&quot;com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher&quot; /&gt;
      &lt;receiver android:name=&quot;com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver&quot;&gt;
          &lt;intent-filter&gt;
              &lt;action android:name=&quot;android.intent.action.BOOT_COMPLETED&quot; /&gt;
              &lt;action android:name=&quot;android.intent.action.QUICKBOOT_POWERON&quot; /&gt;
              &lt;action android:name=&quot;com.htc.intent.action.QUICKBOOT_POWERON&quot;/&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p><strong>Here's the Android/build.gradle</strong></p>
  <pre><code>   buildscript {
     ext {
      buildToolsVersion = &quot;29.0.3&quot;
      minSdkVersion = 21
      compileSdkVersion = 29
      targetSdkVersion = 29
      ndkVersion = &quot;20.1.5948944&quot;  
      googlePlayServicesVersion = &quot;+&quot;
      firebaseVersion = &quot;+&quot;
      firebaseMessagingVersion = &quot;+&quot;
  }
      repositories {
      google()
      jcenter()
  }
      dependencies {
      classpath(&quot;com.android.tools.build:gradle:4.1.0&quot;)
      classpath 'com.google.gms:google-services:4.3.3'
      // NOTE: Do not place your application dependencies here; they belong
      // in the individual module build.gradle files
  }}
      allprojects {
      repositories {
      mavenLocal()
      maven {
          // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
          url(&quot;$rootDir/../node_modules/react-native/android&quot;)
      }
      maven {
          // Android JSC is installed from npm
          url(&quot;$rootDir/../node_modules/jsc-android/dist&quot;)
      }
  
      google()
      jcenter()
      maven { url 'https://www.jitpack.io' }
  }}
  </code></pre>