title: Default FirebaseApp is not initialized in this process. - Android Studio Error
body: <p>I'm having trouble using <strong>Firebase authenticatio</strong>n in conjunction with <strong>FirebaseUI</strong>. When I run my application the following problem appears: "Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp (Context) first."</p>
  
  <p>In my app / build.gradle I have the dependencies:
       </p>
  
  <pre><code>     implementation 'com.google.firebase: firebase-core: 16.0.1'
       implementation 'com.google.firebase: firebase-auth: 16.0.1'
       implementation 'com.google.firebase: firebase-database: 16.0.1'
       implementation 'com.firebaseui: firebase-ui-auth: 4.1.0'
  </code></pre>
  
  <p>and the <code>"apply plugin: 'com.google.gms.google-services"</code> at the end.</p>
  
  <p>in my module / build.gradle I have dependency:
           </p>
  
  <pre><code>classpath 'com.google.gms: google-services: 4.1.0'
  classpath 'com.android.tools.build:gradle:3.3.0-alpha07'
  </code></pre>
  
  <p>I have already exported my googleservices.json to the "app" folder. I was left with no options and the problem continues. Any suggestions?</p>
  
  <p>Logcat:</p>
  
  <p>--------- beginning of crash</p>
  
  <pre><code>08-31 19:40:12.718 2865-2865/? E/AndroidRuntime: FATAL EXCEPTION: main
      Process: br.com.luccas.buscaperto, PID: 2865
      java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.luccas.buscaperto/br.com.luccas.buscaperto.MainActivity}: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process br.com.luccas.buscaperto. Make sure to call FirebaseApp.initializeApp(Context) first.
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
          at android.app.ActivityThread.-wrap11(ActivityThread.java)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:148)
          at android.app.ActivityThread.main(ActivityThread.java:5417)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
       Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process br.com.luccas.buscaperto. Make sure to call FirebaseApp.initializeApp(Context) first.
          at com.google.firebase.FirebaseApp.getInstance(SourceFile:218)
          at com.google.firebase.auth.FirebaseAuth.getInstance(Unknown Source)
          at br.com.luccas.buscaperto.MainActivity.instantiateUser(MainActivity.java:89)
          at br.com.luccas.buscaperto.MainActivity.onCreate(MainActivity.java:64)
          at android.app.Activity.performCreate(Activity.java:6237)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
          at android.app.ActivityThread.-wrap11(ActivityThread.java) 
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
          at android.os.Handler.dispatchMessage(Handler.java:102) 
          at android.os.Looper.loop(Looper.java:148) 
          at android.app.ActivityThread.main(ActivityThread.java:5417) 
          at java.lang.reflect.Method.invoke(Native Method) 
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  </code></pre>
  
  <p>my top level gradle:</p>
  
  <pre><code>buildscript {
      ext {
          release = [
                  versionName: "6.1.0-rc01",
                  versionCode: 6100
          ]
  
          setup = [
                  compileSdk: 28,
                  buildTools: "28.0.2",
                  minSdk    : 14,
                  targetSdk : 28
          ]
  
          versions = [
                  androidX: '1.0.0-rc01'
          ]
      }
  
      repositories {
          google()
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.3.0-alpha07'
          classpath 'com.google.gms:google-services:4.1.0'
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
      }
  }
  </code></pre>
  
  <p>my app level gradle: </p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 28
      defaultConfig {
          applicationId "br.com.luccas.buscaperto"
          minSdkVersion 21
          targetSdkVersion 28
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      buildToolsVersion '28.0.2'
  }
  
  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation "androidx.legacy:legacy-support-v4:${versions.androidX}"
      implementation "androidx.appcompat:appcompat:${versions.androidX}"
      implementation "androidx.constraintlayout:constraintlayout:${versions.androidX}"
      implementation "androidx.recyclerview:recyclerview:${versions.androidX}"
      implementation "androidx.annotation:annotation:${versions.androidX}"
  
      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.mikepenz:materialdrawer:6.1.0-rc01'
      implementation "com.google.android.material:material:${versions.androidX}"
  
      implementation 'com.google.firebase:firebase-core:16.0.3'
      implementation 'com.google.firebase:firebase-auth:16.0.3'
      implementation 'com.google.firebase:firebase-database:16.0.1'
      implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
  
      implementation 'com.jakewharton:butterknife:8.8.1'
      annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
  }
  apply plugin: 'com.google.gms.google-services'
  </code></pre>