title: How to add authentication to a Uber clone app using Flutter and Dart?
body: <p>I just started using Flutter/dart and encountered this while working on firebase auth for phone number
  Error while adding google-services.json file to my project for auth.
  What I get while trying to build the apk:
  The code is working perfectly. yesterday the whole process was working got OPT Code and registered my phone number on firebase auth services. Today I woke up tried it and it kept on displaying the same error. I looked through stackoverflow, tried everything but nothing worked so I decided to post it and ask for help.</p>
  <pre><code>FAILURE: Build failed with an exception.
  * What went wrong:
  Execution failed for task ':app:checkDebugAarMetadata'.
  &gt; Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
     &gt; Failed to transform play-services-measurement-impl-19.0.2.aar (com.google.android.gms:play-services-measurement-impl:19.0.2) to match attributes {artifactType=android-aar-metadata, org.gradle.status=release}.
        &gt; Execution failed for JetifyTransform: C:\Users\webdono\.gradle\caches\modules-2\files-2.1\com.google.android.gms\play-services-measurement-impl\19.0.2\9d36784c3918cfb99afcad0fd65063a28e25be5b\play-services-measurement-impl-19.0.2.aar.
           &gt; Failed to transform 'C:\Users\webdono\.gradle\caches\modules-2\files-2.1\com.google.android.gms\play-services-measurement-impl\19.0.2\9d36784c3918cfb99afcad0fd65063a28e25be5b\play-services-measurement-impl-19.0.2.aar' using Jetifier. Reason: ZipException, message: invalid distance code. (Run with --stacktrace for more details.)
             Suggestions:
              - Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&amp;s=modified_time:desc, it's possible that this issue has already been filed there.
              - If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).
     &gt; Failed to transform play-services-measurement-impl-19.0.2.aar (com.google.android.gms:play-services-measurement-impl:19.0.2) to match attributes {artifactType=android-aar-metadata, org.gradle.status=release}.
        &gt; Execution failed for JetifyTransform: C:\Users\webdono\.gradle\caches\modules-2\files-2.1\com.google.android.gms\play-services-measurement-impl\19.0.2\9d36784c3918cfb99afcad0fd65063a28e25be5b\play-services-measurement-impl-19.0.2.aar.
           &gt; Failed to transform 'C:\Users\webdono\.gradle\caches\modules-2\files-2.1\com.google.android.gms\play-services-measurement-impl\19.0.2\9d36784c3918cfb99afcad0fd65063a28e25be5b\play-services-measurement-impl-19.0.2.aar' using Jetifier. Reason: ZipException, message: invalid distance code. (Run with --stacktrace for more details.)
             Suggestions:
              - Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&amp;s=modified_time:desc, it's possible that this issue has already been filed there.
              - If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 33s
  Exception: Gradle task assembleDebug failed with exit code 1
  Exited (sigterm)
  </code></pre>
  <p>my build.gradle file:</p>
  <pre><code>buildscript {
      ext.kotlin_version = '1.3.50'
      repositories {
          google()
          jcenter()
      }
  
      dependencies {
          classpath 'com.android.tools.build:gradle:4.2.2'
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
          classpath 'com.google.gms:google-services:4.3.10'
          
           
      }
  }
  
  allprojects {
      repositories {
          
          google()
          jcenter()
      }
  }
  
  rootProject.buildDir = '../build'
  subprojects {
      project.buildDir = &quot;${rootProject.buildDir}/${project.name}&quot;
  }
  subprojects {
      project.evaluationDependsOn(':app')
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  <p>app/build.gradle file</p>
  <pre><code>def localProperties =  new Properties()
  def localPropertiesFile = rootProject.file('local.properties')
  if (localPropertiesFile.exists()) {
      localPropertiesFile.withReader('UTF-8') { reader -&gt;
          localProperties.load(reader)
      }
  }
  
  def flutterRoot = localProperties.getProperty('flutter.sdk')
  if (flutterRoot == null) {
      throw new GradleException(&quot;Flutter SDK not found. Define location with flutter.sdk in the local.properties file.&quot;)
  }
  
  def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  if (flutterVersionCode == null) {
      flutterVersionCode = '1'
  }
  
  def flutterVersionName = localProperties.getProperty('flutter.versionName')
  if (flutterVersionName == null) {
      flutterVersionName = '1.0'
  }
  
  apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android'
  apply from: &quot;$flutterRoot/packages/flutter_tools/gradle/flutter.gradle&quot;
  apply plugin: 'com.google.gms.google-services'
  
  android {
      compileSdkVersion 28
  
      sourceSets {
          main.java.srcDirs += 'src/main/kotlin'
      }
  
      lintOptions {
          disable 'InvalidPackage'
      }
  
      defaultConfig {
          // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
          applicationId &quot;com.mycab.driver&quot;
          minSdkVersion 21
          targetSdkVersion 28
          versionCode flutterVersionCode.toInteger()
          versionName flutterVersionName
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
      buildTypes {
          release {
              // TODO: Add your own signing config for the release build.
              // Signing with the debug keys for now, so `flutter run --release` works.
              signingConfig signingConfigs.debug
          }
      }
  }
  
  flutter {
      source '../..'
  }
  
  dependencies {
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.1.1'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
      implementation platform('com.google.firebase:firebase-bom:28.4.2')
      implementation 'androidx.browser:browser:1.3.0'
      implementation 'com.google.android.gms:play-services-analytics:16.0.0'
      implementation 'com.google.firebase:firebase-analytics'
      
  }
  </code></pre>
  <p>Fixed!! Gradle 7.2 didn't support certain dependecies had to change it to Gradle 5.6.2.</p>