title: Flutter run release fails: Minimum supported Gradle version is 5.6.4. Current version is 5.6.2
body: <p>When trying to run my app with <code>flutter run --release</code> it throws an error:</p>
  
  <pre><code>FAILURE: Build failed with an exception.
  
  * Where:
  Build file 'C:\Users\Chris\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\device_info-0.4.2+1\android\build.gradle' line: 22
  
  * What went wrong:
  A problem occurred evaluating root project 'device_info'.
  &gt; Failed to apply plugin [id 'com.android.internal.version-check']
  &gt; Minimum supported Gradle version is 5.6.4. Current version is 5.6.2. If using the gradle wrapper, try editing the distributionUrl in C:\Users\Chris\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\device_info-0.4.2+1\android\gradle\wrapper\gradle-wrapper.properties to gradle-5.6.4-all.zip
  </code></pre>
  
  <p>If I remove this device_info plugin, I get the same error just pointing to Gradle current version to be 4.10.2 due to another plugin flutter_plugin_android_lifecycle.</p>
  
  <p>I don't understand. I tried updating my gradle-wrapper.properties to</p>
  
  <pre><code>distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
  </code></pre>
  
  <p>Previously it was set to 5.6.2, but this changed nothing. Also tried with 4.10.2, but it equally just get's ignored.
  I updated the gradle version in my build.gradle to</p>
  
  <pre><code>buildscript {
      ext.kotlin_version = '1.3.61'
      repositories {
          google()
          jcenter()
      }
  
      dependencies {
          classpath 'com.android.tools.build:gradle:3.6.2'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
      }
  }
  </code></pre>
  
  <p>I created a new flutter project, just copied my pages and the pubspec... I tried in console, I tried with android studio. flutter clean, flutter build appBundle, deleting gradle versions, I tried everything I could think of or that I have read somewhere...
  Nothing could help to get rid of this error, gradle insists that its current version is 5.6.2.
  A new "virgin" flutter project however, I can run in release mode, without problems.</p>
  
  <p>It appears these plugins will download their own gradle version. I could see it in Android Studio how an old gradle version is downloaded in contrary to the actual gradle version stated in my settings. Either way after 3 days with this, I'm running out of options and ideas.</p>
  
  <p>Does anyone know how to solve this or to narrow the problem down? I also would be glad for an explanation on what's going on here.</p>
  
  <p>My flutter doctor output:</p>
  
  <pre><code>[√] Flutter (Channel master, v1.17.1-pre.23, on Microsoft Windows [Version 10.0.18362.720], locale de-DE)
      • Flutter version 1.17.1-pre.23 at C:\flutter
      • Framework revision a2e6c30b44 (12 hours ago), 2020-04-03 20:26:01 -0700
      • Engine revision 09bc1fc45e
      • Dart version 2.8.0 (build 2.8.0-dev.19.0 e736495eb7)
  
  
  [√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
      • Android SDK at C:\Users\Chris\AppData\Local\Android\sdk
      • Platform android-R, build-tools 29.0.3
      • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
      • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
      • All Android licenses accepted.
  
  [√] Android Studio (version 3.6)
      • Android Studio at C:\Program Files\Android\Android Studio
      • Flutter plugin version 45.0.1
      • Dart plugin version 192.7761
      • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
  
  [√] VS Code (version 1.43.2)
      • VS Code at C:\Users\Chris\AppData\Local\Programs\Microsoft VS Code
      • Flutter extension version 3.9.0
  
  [√] Connected device (1 available)
      • Lenovo A6020l36 • 32aac289 • android-arm64 • Android 5.1.1 (API 22)
  
  • No issues found!
  </code></pre>