title: Flutter - FirebaseApp with name [DEFAULT] doesn't exist
body: <p>I'm working on a flutter application using firebase authentication system and Firestore. I worked for 3 months and I didn't encounter this error before. Now I published my application on play store and I found this error also for debug version with the emulator. I think to have configured properly the system because firebase worked for a while.
  I think that this error occurs for all the apk that I builded after the upgrade of flutter. </p>
  
  <p>Some suggestion to solve my problem?
  Thanks </p>
  
  <p>I enter my bundle ID on firebase and download the google-service.json file, copy and paste on android/app folder and build. I also tried to clean (as mentioned here <a href="https://github.com/flutter/flutter/issues/28003" rel="nofollow noreferrer">https://github.com/flutter/flutter/issues/28003</a> )  and build the project and to enter some SHA1 and SHA-256 fingerprints to try if it was this the problem but I'm not sure which SHA1 enter on firebase.  ReDownloaded the google-service.json and clean - build the project.</p>
  
  <p>Other codes to initialise the FirebaseApp seems pretty old and I don't think that it can work for me like here (<a href="https://stackoverflow.com/questions/37346363/java-lang-illegalstateexception-firebaseapp-with-name-default">java.lang.IllegalStateException: FirebaseApp with name [DEFAULT]</a>) .</p>
  
  <p>I just authenticate a user using this code </p>
  
  <pre><code>      user = await FirebaseAuth.instance
            .signInWithEmailAndPassword(email: _email, password: _password);
  </code></pre>
  
  <p>and do some try catch to manage the output. </p>
  
  <p>android/build.gradle</p>
  
  <pre><code>buildscript {
      repositories {
          google()
          jcenter()
      }
  
      dependencies {
          classpath 'com.android.tools.build:gradle:3.3.1'
          classpath 'com.google.gms:google-services:4.1.0'
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
      }
  }
  
  rootProject.buildDir = '../build'
  subprojects {
      project.buildDir = "${rootProject.buildDir}/${project.name}"
  }
  subprojects {
      project.evaluationDependsOn(':app')
  }
  
  subprojects {
      project.configurations.all {
          resolutionStrategy.eachDependency { details -&gt;
              if (details.requested.group == 'com.android.support'
                      &amp;&amp; !details.requested.name.contains('multidex') ) {
                  details.useVersion "27.1.1"
              }
          }
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>android/app/build.gradle</p>
  
  <pre><code>android {
      compileSdkVersion 28
  
      lintOptions {
          disable 'InvalidPackage'
      }
  
      defaultConfig {
          applicationId "com.luxywebdesign.pocketstcw"
          minSdkVersion 18
          targetSdkVersion 28
          versionCode flutterVersionCode.toInteger()
          versionName flutterVersionName
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
          multiDexEnabled true
      }
  
      signingConfigs {
          release {
              storeFile file("my-release-key.keystore")
              storePassword "StorePassword"
              keyAlias "KeyAlias"
              keyPassword "Password"
          }
      }
      buildTypes {
          release {
              // Signing with the debug keys for now, so `flutter run --release` works.
              signingConfig signingConfigs.release
          }
      }
  }
  
  flutter {
      source '../..'
  }
  
  dependencies {
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.2'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
      implementation 'com.google.firebase:firebase-core:16.0.1'
  }
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>pubspec.yaml</p>
  
  <pre><code>environment:
    sdk: "&gt;=2.1.0 &lt;3.0.0"
    firebase_storage:
  
  dependencies:
    flutter:
      sdk: flutter
    firebase_auth: 0.8.2
    file_picker: ^1.3.3
    firebase_storage: ^2.1.0+1
    firebase_core: 0.3.1+1
    cloud_firestore: ^0.9.7
    permission_handler: ^2.2.0
    path_provider: ^0.5.0+1
    http: ^0.12.0+1
    url_launcher: ^5.0.2
    open_file: ^2.0.1+2
    datetime_picker_formfield: ^0.1.8
    share:
      git:
        url: https://github.com/d-silveira/flutter-share.git
    flutter_launcher_icons: ^0.7.0
    image_picker: ^0.6.0+1
    modal_progress_hud: ^0.1.3
    flutter_keychain: ^1.0.0
    pdf: ^1.3.7
    image: ^2.0.7
    flutter_local_notifications: ^0.6.1
    auto_size_text: ^2.0.1
    shared_preferences: ^0.5.3+1
  </code></pre>
  
  <p>Error message : </p>
  
  <pre><code>D/FirebaseApp(23461): Default FirebaseApp failed to initialize because no default options were found. This usually means that com.google.gms:google-services was not applied to your gradle project.
  </code></pre>
  
  <p>at the start after the installation of the apk and ...</p>
  
  <pre><code>E/MethodChannel#plugins.flutter.io/firebase_auth(23461): Failed to handle method call
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461): java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist. 
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@16.1.0:280)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at io.flutter.plugins.firebaseauth.FirebaseAuthPlugin.getAuth(FirebaseAuthPlugin.java:76)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at io.flutter.plugins.firebaseauth.FirebaseAuthPlugin.onMethodCall(FirebaseAuthPlugin.java:108)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at android.os.MessageQueue.nativePollOnce(Native Method)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at android.os.MessageQueue.next(MessageQueue.java:326)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at android.os.Looper.loop(Looper.java:160)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at android.app.ActivityThread.main(ActivityThread.java:6669)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at java.lang.reflect.Method.invoke(Native Method)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
  E/MethodChannel#plugins.flutter.io/firebase_auth(23461):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
  </code></pre>