FirebaseApp with name [DEFAULT] doesn't exist
<p>After migrating to Firebase Cloud Messaging.When opening my app it crashes and throws an error saying <code>java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.</code> I already put my new google-services.json and update my SDK. </p>

<p>Here's my MainActivity</p>

<pre><code>public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

//Check Google play service
    GoogleApiAvailability googleAPI = GoogleApiAvailability.getInstance();
    int resultCode = googleAPI.isGooglePlayServicesAvailable(this);

    if (resultCode != ConnectionResult.SUCCESS) {
        if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
            GooglePlayServicesUtil.getErrorDialog(resultCode, this,
                    PLAY_SERVICES_RESOLUTION_REQUEST).show();
        } else {
            Log.e(LOG_TAG, "This device is not supported.");
            finish();
        }
    }

    Log.i(TAG, "InstanceID token: " + FirebaseInstanceId.getInstance().getToken());

}
}
</code></pre>