FirebaseInstanceIdService getToken returning null
<p>Im trying to add FCM notifications to my app, but for some reason </p>

<pre><code>FirebaseInstanceId.getInstance().getToken();
</code></pre>

<p>is returning null.</p>

<p>Since im not getting any stacktrace my best guess is that FirebaseInstanceIdService is not working</p>

<ul>
<li>Google Play Services version: 9.6.1</li>
<li>Firebase-messaging version : 9.6.1</li>
<li>added json config file from FirebaseConsole (Tried single file with 2 clients inside it, one for debug and one for release build) and 2 files each for respective build </li>
</ul>

<p>Iw applied google services plugin at the bottom of my modules gradle script 
Included google services in projects root gradle script</p>

<p>Created 2 services from the officail docs:</p>

<pre><code>public class MyFirebaseInsanceIDService  extends FirebaseInstanceIdService {

private static final String TAG = "MyFirebaseIIDService";

@Override
public void onTokenRefresh() {
    // Get updated InstanceID token.
    String refreshedToken = FirebaseInstanceId.getInstance().getToken();
    PreferencesHelper.putSharedPreferencesString(Constants.User.PUSH_NOTIFICATIONS, refreshedToken);

    Log.e("TOKEN", "Token: " + FirebaseInstanceId.getInstance().getToken());
}
</code></pre>

<p>}</p>

<p>And the manifest:</p>

<pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.fc.test"&gt;

&lt;uses-permission android:name="android.permission.DISABLE_KEYGUARD" /&gt;
&lt;uses-permission android:name="android.permission.INTERNET" /&gt;

&lt;application
    android:name="fctest"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="${appName}${appNameSuffix}"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:node="replace"&gt;

    &lt;service
        android:name="com.fc.test.MyFirebaseInsanceIDService"
        android:enabled="true"
        android:exported="true"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="com.google.firebase.INSTANCE_ID_EVENT" /&gt;
        &lt;/intent-filter&gt;
    &lt;/service&gt;

    &lt;service
        android:name="com.fc.test.MyFirebaseMessagingService"
        android:enabled="true"
        android:exported="true"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="com.google.firebase.MESSAGING_EVENT" /&gt;
        &lt;/intent-filter&gt;
    &lt;/service&gt;

    &lt;activity
        android:name="com.fc.test.view.splash.Splash"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.CenterAnimation"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.MAIN" /&gt;

            &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
        &lt;/intent-filter&gt;
    &lt;/activity&gt;

&lt;/application&gt;
</code></pre>

<p></p>

<p>root Gradle:</p>

<pre><code>buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        //noinspection GradleDynamicVersion
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "http://dl.bintray.com/drummer-aidan/maven" }
        maven { url "https://maven.fabric.io/public" }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://jitpack.io" }
    }
}

ext {
    buildToolsVersion = '24.0.1'
    compileSdkVersion = 24
    minSdkVersion = 15
    targetSdkVersion = 24
    supportLibraryVersion = '24.2.1'
}
</code></pre>

<p>and the main part of the modules Gradle</p>

<pre><code>    dependencies {
    final PLAY_SERVICES_VERSION = '9.6.1'
    final SUPPORT_LIBRARY_VERSION = '24.2.1'
    final RETROFIT_VERSION = '2.1.0'
    final DAGGER_VERSION = '2.5'
    final DEXMAKER_VERSION = '1.4'
    final HAMCREST_VERSION = '1.3'
    final ESPRESSO_VERSION = '2.2.1'
    final RUNNER_VERSION = '0.4'
    final BUTTERKNIFE_VERSION = '8.1.0'
    def daggerCompiler = "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
    def jUnit = "junit:junit:4.12"
    def mockito = "org.mockito:mockito-core:1.10.19"
    // App Dependencies
    compile "com.google.android.gms:play-services-gcm:$PLAY_SERVICES_VERSION"
    compile "com.google.firebase:firebase-messaging:$PLAY_SERVICES_VERSION"
    compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION"
    compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
    compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
    compile "com.squareup.retrofit2:adapter-rxjava:$RETROFIT_VERSION"
    compile "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
    compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
        transitive = true;
    }
}
apply plugin: 'com.google.gms.google-services
</code></pre>

<ul>
<li>Note that im using <code>tools:node="replace"</code>  in my root application tag.
Is it possible that <code>FirebaseInstanceIdService</code> is not added to the manifest since it has the same intent filter as mine <code>FirebaseInstanceService</code> and thus not being called?</li>
</ul>

<p>So my question here would be is there something wrong it the official docs or in my implementation that should cause the Instance token to be null?</p>