title: Can't connect to Firebase in Android Studio
body: <p>I’ve tried all solutions and I still can’t make my app connected to Firebase server </p>
  
  <p><a href="https://i.stack.imgur.com/0WZbP.jpg" rel="nofollow noreferrer">https://i.stack.imgur.com/0WZbP.jpg</a></p>
  
  <p>noted that I’m using this build.gradle in root ;</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      repositories {
          google()
          jcenter()
  
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.3.0'
          classpath 'com.google.gms:google-services:4.2.0'
  
  
  
  
  
          buildscript {
  
          }
  
          }
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  
  
  
  allprojects {
  
  
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
  
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>and this one for App gradle ;</p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'com.google.gms.google-services'
  
  android {
      signingConfigs {
          config1 {
              keyAlias 'key0'
              keyPassword '000000'
              storeFile file('C:/filepath/filename.jks')
              storePassword 'password'
          }
      }
      defaultConfig {
          applicationId "com.example.last"
          minSdkVersion 21
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
          signingConfig signingConfigs.config1
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
      productFlavors {
      }
      compileSdkVersion 28
  }
  
  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      //noinspection GradleCompatible
      implementation 'com.android.support:appcompat-v7:28.0.0'
      implementation 'com.android.support.constraint:constraint-layout:1.1.3'
      implementation 'com.google.firebase:firebase-messaging:17.3.4'
      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.6'
      android {
          // ...
  
      }}
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>I installed the google-services.json file </p>
  
  <p>Nothing is working and I completed all required steps , still have no connection</p>
  
  <p>Does anyone can help me ?</p>
  
  <p>Thanks </p>