Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle wrapper error when doing 'flutter run' on a fresh flutter project #8148

Closed
yyoon opened this issue Feb 14, 2017 · 5 comments
Closed
Assignees
Labels
platform-android Android applications specifically t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@yyoon
Copy link
Contributor

yyoon commented Feb 14, 2017

Steps to Reproduce

flutter create and then flutter run in the created directory.

Logs

youngseokyoon list_view$ flutter run
Launching lib/main.dart on Pixel C in debug mode...
Running 'gradle wrapper'...                               

FAILURE: Build failed with an exception.

* Where:
Build file '/usr/local/google/home/youngseokyoon/Programming/temp/list_view/android/app/build.gradle' line: 14

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Minimum supported Gradle version is 2.14.1. Current version is 2.13. If using the gradle wrapper, try editing the distributionUrl in /usr/local/google/home/youngseokyoon/Programming/temp/list_view/android/gradle/wrapper/gradle-wrapper.properties to gradle-2.14.1-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Exception from flutter run: Exception: Exception: Gradle failed: 1
package:flutter_tools/src/base/common.dart 29              throwToolExit
package:flutter_tools/src/android/gradle.dart 163          ensureGradlew.<async>
dart:async                                                 _SyncCompleter.complete
package:flutter_tools/src/base/process.dart 113            runCommandAndStreamOutput.<async>
===== asynchronous gap ===========================
dart:async                                                 _Completer.completeError
package:flutter_tools/src/android/gradle.dart 174          ensureGradlew.<async>
dart:async                                                 _SyncCompleter.complete
package:flutter_tools/src/base/process.dart 113            runCommandAndStreamOutput.<async>
===== asynchronous gap ===========================
dart:async                                                 _asyncThenWrapperHelper
package:flutter_tools/src/android/gradle.dart              ensureGradlew
package:flutter_tools/src/android/gradle.dart 192          buildGradleProject.<async>
===== asynchronous gap ===========================
dart:async                                                 Future.Future.microtask
package:flutter_tools/src/android/gradle.dart              buildGradleProject
package:flutter_tools/src/commands/build_apk.dart 610      buildAndroidWithGradle.<async>
===== asynchronous gap ===========================
dart:async                                                 Future.Future.microtask
package:flutter_tools/src/commands/build_apk.dart          buildAndroidWithGradle
package:flutter_tools/src/commands/build_apk.dart 620      buildApk.<async>
===== asynchronous gap ===========================
dart:async                                                 Future.Future.microtask
package:flutter_tools/src/commands/build_apk.dart          buildApk
package:flutter_tools/src/android/android_device.dart 287  AndroidDevice.startApp.<async>
dart:async                                                 _SyncCompleter.complete
package:flutter_tools/src/base/process.dart 113            runCommandAndStreamOutput.<async>
===== asynchronous gap ===========================
dart:async                                                 _asyncThenWrapperHelper
package:flutter_tools/src/android/android_device.dart      AndroidDevice.startApp
package:flutter_tools/src/run_hot.dart 160                 HotRunner._run.<async>
dart:async                                                 _SyncCompleter.complete
package:flutter_tools/src/resident_runner.dart 184         ResidentRunner.startEchoingDeviceLog.<async>
===== asynchronous gap ===========================
dart:async                                                 _asyncThenWrapperHelper
package:flutter_tools/src/run_hot.dart                     HotRunner._run
package:flutter_tools/src/run_hot.dart 77                  HotRunner.run.<fn>
package:stack_trace                                        Chain.capture
package:flutter_tools/src/run_hot.dart 76                  HotRunner.run
package:flutter_tools/src/commands/run.dart 278            RunCommand.runCommand.<async>

Flutter Doctor

youngseokyoon list_view$ flutter doctor
[✓] Flutter (on Linux, channel master)
    • Flutter at /usr/local/google/home/youngseokyoon/Programming/fuchsia/lib/flutter
    • Framework revision 36f6405179 (2 hours ago), 2017-02-14 10:58:33
    • Engine revision f306a6f701
    • Tools Dart version 1.22.0-dev.10.6

[✓] Android toolchain - develop for Android devices (Android SDK 23.0.2)
    • Android SDK at /usr/local/google/home/youngseokyoon/Android/Sdk
    • Platform android-24, build-tools 23.0.2
    • ANDROID_HOME = /usr/local/google/home/youngseokyoon/Android/Sdk
    • OpenJDK Runtime Environment (build 1.8.0_112-google-v7-146844476-143772575)

[-] IntelliJ IDEA Community Edition (version 2016.3)
    • Dart plugin not installed; this adds Dart specific functionality.
    • Flutter plugin not installed; this adds Flutter specific functionality.
    • For information about managing plugins, see
      https://www.jetbrains.com/help/idea/managing-plugins.html

[✓] Connected devices
    • Pixel C • 5C08000423 • android-arm • Android 7.0 (API 24)
@abarth
Copy link
Contributor

abarth commented Feb 14, 2017

/cc @jakobr-google

We should:

  • Produce a better error message
  • Teach doctor how to check for this issue.

@abarth abarth added tool Affects the "flutter" command-line tool. See also t: labels. t: flutter doctor Problem related to the "flutter doctor" tool platform-android Android applications specifically labels Feb 14, 2017
@abarth abarth added this to the 2: Make Early Adopters happy milestone Feb 14, 2017
@abarth abarth moved this from TODO to Critical in Make gradle build great! Feb 14, 2017
@yyoon
Copy link
Contributor Author

yyoon commented Feb 14, 2017

So manually installing a newer version of gradle seems to have helped, but this is odd because AFAIK gradle wrapper approach shouldn't require a gradle installation on the machine.

@jakobr-google jakobr-google moved this from Critical to In Progress in Make gradle build great! Feb 15, 2017
jakobr-google added a commit to jakobr-google/flutter that referenced this issue Feb 15, 2017
The recommendation from Gradle is to check in the gradlew scripts and
contents of gradle/wrapper. This way we don't have to depend on the
system gradle from Android Studio to create the wrapper before we can
build.

Fixes flutter#8148
Fixes flutter#8131
@jakobr-google
Copy link
Contributor

The gradle wrapper approach doesn't depend on a gradle installation, but only if we actually add the gradle wrapper files to the template. Coming up.

@jakobr-google
Copy link
Contributor

We decided to depend on the system gradle, so we need flutter doctor to make sure you have the right version installed. Closing this one as dup of #8131.

@github-actions
Copy link

github-actions bot commented Sep 5, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform-android Android applications specifically t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants