mori mori - 1 year ago 1673
Android Question

FirebaseApp with name [DEFAULT] doesn't exist

After migrating to Firebase Cloud Messaging.When opening my app it crashes and throws an error saying

java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.
I already put my new google-services.json and update my SDK.

Here's my MainActivity

public class MainActivity extends Activity {

protected void onCreate(Bundle savedInstanceState) {

//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,
} else {
Log.e(LOG_TAG, "This device is not supported.");

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


Answer Source

Please do double check, you added

apply plugin: '' 

at the bottom of app's gradle file and then clean and rebuild the project