title: Gradle failures following update of android studio to version 3.4
body: <p>I've updated Android studio today and my flutter project is no longer working.  Gradle is failing with the following message:</p>
  
  <hr>
  
  <pre><code>* Error running Gradle:
  ProcessException: Process "C:\Projects\firebase_setup_app\android\gradlew.bat" exited abnormally:
  
  &gt; Configure project :app
  registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
  registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
  registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
  registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
  registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
  WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
  It will be removed at the end of 2019.
  For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
  To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
  WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
  It will be removed at the end of 2019.
  For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
  To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
  WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
  It will be removed at the end of 2019.
  For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
  To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
           *********************************************************
  WARNING: This version of firebase_auth will break your Android build if it or its dependencies aren't compatible with AndroidX.
           See https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility for more information on the problem and how to fix it.
           This warning prints for all Android build failures. The real root cause of the error may be unrelated.
           *********************************************************
    Command: C:\Projects\firebase_setup_app\android\gradlew.bat app:properties
  Finished with error: Please review your Gradle project setup in the android/ folder.
  </code></pre>
  
  <hr>
  
  <p>I've tried making a new flutter project in the latest version of studio and this builds OK.</p>
  
  <p>The issue seems to be around the fact I'm using google play services and  firebase in my project.  I updated google services to the latest (4.2.0) and gradle to 3.4.0 following a prompt from the IDE</p>
  
  <p>I updated the compiledSDKVersion from 27 to 28 in android/app/build.gradle</p>
  
  <p>I've updated the gradle version in android/gradle/gradle-wrapper.properties from 4.10.2 to 5.1.1 as there was an incompatibility and I was prompted to update.</p>
  
  <pre><code>#Fri Jun 23 08:50:38 CEST 2017
  distributionBase=GRADLE_USER_HOME
  distributionPath=wrapper/dists
  zipStoreBase=GRADLE_USER_HOME
  zipStorePath=wrapper/dists
  #distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
  distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
  </code></pre>
  
  <p>I've done the refactor>migrate to AndroidX... and included:</p>
  
  <pre><code>android.useAndroidX=true
  android.enableJetifier=true
  </code></pre>
  
  <p>in the gradle.properties file</p>
  
  <p>I've tried clearing the cache via 'File>Invalidate Caches and restart...'</p>
  
  <p>I have tried flutter clean and flutter doctor -v with no issues shown:</p>
  
  <pre><code>C:\Projects\firebase_setup_app&gt;flutter clean
  Deleting 'build\'.
  Deleting 'C:\Projects\firebase_setup_app\.dart_tool\'.
  
  C:\Projects\firebase_setup_app&gt;flutter doctor
  Doctor summary (to see all details, run flutter doctor -v):
  [√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 6.3.9600], locale en-GB)
  [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
  [√] Android Studio (version 3.4)
  [√] IntelliJ IDEA Community Edition (version 2018.3)
  [√] Connected device (1 available)
  
  • No issues found!
  
  C:\Projects\firebase_setup_app&gt;flutter doctor -v
  [√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 6.3.9600], locale en-GB)
      • Flutter version 1.2.1 at C:\src\flutter\flutter_windows_v1.0.0-stable\flutter
      • Framework revision 8661d8aecd (10 weeks ago), 2019-02-14 19:19:53 -0800
      • Engine revision 3757390fa4
      • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)
  
  [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
      • Android SDK at C:\Android\sdk
      • Android NDK location not configured (optional; useful for native profiling support)
      • Platform android-28, build-tools 28.0.3
      • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
      • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
      • All Android licenses accepted.
  
  [√] Android Studio (version 3.4)
      • Android Studio at C:\Program Files\Android\Android Studio1
      • Flutter plugin version 34.0.2
      • Dart plugin version 183.5901
      • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
  
  [√] IntelliJ IDEA Community Edition (version 2018.3)
      • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.3
      • Flutter plugin version 31.3.4
      • Dart plugin version 183.5153.38
  
  [√] Connected device (1 available)
      • SM G930F • ce0616069dbace2f03 • android-arm64 • Android 8.0.0 (API 26)
  
  • No issues found!
  </code></pre>
  
  <hr>
  
  <p>I've also updated the android/build.gradle dependencies:</p>
  
  <pre><code>   dependencies {
          classpath 'com.android.tools.build:gradle:3.4.0'
          //classpath 'com.android.tools.build:gradle:3.2.1'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
          classpath 'com.google.gms:google-services:4.2.0'
      }
  </code></pre>
  
  <p>The android/app/build.gradle dependencies are as follows:</p>
  
  <pre><code>dependencies {
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
      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>my pubspec.yaml includes the following plugins:</p>
  
  <pre><code>environment:
    sdk: "&gt;=2.0.0-dev.68.0 &lt;3.0.0"
  
  dependencies:
    flutter:
      sdk: flutter
  
    # The following adds the Cupertino Icons font to your application.
    # Use with the CupertinoIcons class for iOS style icons.
    cupertino_icons: ^0.1.2
    google_sign_in: ^4.0.1+3
    firebase_auth: ^0.8.4+5
    firebase_core: ^0.3.4
    #firebase_core: any
    firebase_database: ^2.0.3
  </code></pre>
  
  <p>Any suggestions please to resolve greatly appreciated!</p>