Skip to content

* Error running Gradle: #23095

Closed
Closed

Description

@Sky24n

Steps to Reproduce

Launching lib\main.dart on Letv X500 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
Exit code 1 from: D:\Program Files\Android\temp workspace\flutter_appp\android\gradlew.bat app:properties:
Parallel execution with configuration on demand is an incubating feature.

Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\Program Files\Android\temp workspace\flutter_appp\android\app\build.gradle' line: 25

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
   > Could not find bundletool.jar (com.android.tools.build:bundletool:0.1.0-alpha01).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/bundletool/0.1.0-alpha01/bundletool-0.1.0-alpha01.jar
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
   > Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.1.0).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.1.0/aapt2-proto-0.1.0.jar

* 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 2s

Finished with error: Please review your Gradle project setup in the android/ folder.

Logs

D:\Program Files\Android\temp workspace\flutter_appp\foo>flutter run
Launching lib/main.dart on Letv X500 in debug mode...
Initializing gradle...                                       1.2s
Resolving dependencies...
* Error running Gradle:
Exit code 1 from: D:\Program Files\Android\temp workspace\flutter_appp\foo\android\gradlew.bat app:properties:
Parallel execution with configuration on demand is an incubating feature.

Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\Program Files\Android\temp workspace\flutter_appp\foo\android\app\build.gradle' line: 25

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
   > Could not find bundletool.jar (com.android.tools.build:bundletool:0.1.0-alpha01).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/bundletool/0.1.0-alpha01/bundletool-0.1.0-alpha01.jar
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
   > Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.1.0).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.1.0/aapt2-proto-0.1.0.jar

* 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 2s

Please review your Gradle project setup in the android/ folder.

D:\Program Files\Android\temp workspace\flutter_appp>flutter doctor -v
[√] Flutter (Channel beta, v0.8.2, on Microsoft Windows [Version 10.0.17134.345], locale zh-CN)
    • Flutter version 0.8.2 at D:\Develop\Flutter\flutter
    • Framework revision 5ab9e70727 (5 weeks ago), 2018-09-07 12:33:05 -0700
    • Engine revision 58a1894a1c
    • Dart version 2.1.0-dev.3.1.flutter-760a9690c2

[√] Android toolchain - develop for Android devices (Android SDK 28.0.2)
    • Android SDK at D:\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.2
    • ANDROID_HOME = D:\sdk
    • Java binary at: D:\Develop\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[√] Android Studio (version 3.2)
    • Android Studio at D:\Develop\Android\Android Studio
    • Flutter plugin version 28.0.2
    • Dart plugin version 181.5616
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[!] IntelliJ IDEA Ultimate Edition (version 2017.2)
    • IntelliJ at D:\Develop\JetBrains\IntelliJ IDEA 2017.2.5
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[√] Connected devices (1 available)
    • Letv X500 • E6C6TKSKCUDM7P4T • android-arm64 • Android 6.0 (API 23)

! Doctor found issues in 1 category.

Activity

  1. added
    c: crash
    tool
    t: gradle
    on Oct 15, 2018
  2. added this to the milestone on Oct 15, 2018
  3. pboos commented on Oct 23, 2018

    @pboos

    Just had this start to appear on my builds (on build server) today. Even though I didn't change anything in the dependencies.

  4. rodolph66 commented on Oct 23, 2018

    @rodolph66

    I have just finished setting up flutter on windows 10 with Android Studio...

    FLutter doctor output:

    C:\Users\Bob>flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel beta, v0.9.4, on Microsoft Windows [Version 10.0.17134.345], locale en-US)
    [√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    [√] Android Studio (version 3.2)
    [√] VS Code (version 1.28.2)
    [√] Connected devices (1 available)
    
    • No issues found!
    

    However when I perform the test drive I get the following in studio's console:

    Launching lib\main.dart on Android SDK built for x86 in debug mode...
    Initializing gradle...
    Resolving dependencies...
    * Error running Gradle:
    Exit code 1 from: G:\flutter\flutter_test_01\android\gradlew.bat app:properties:
    Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file 'G:\flutter\flutter_test_01\android\app\build.gradle' line: 25
    
    * What went wrong:
    A problem occurred evaluating project ':app'.
    > Could not resolve all files for configuration 'classpath'.
       > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
         Searched in the following locations:
             https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
    
    * 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 1s
    
    Finished with error: Please review your Gradle project setup in the android/ folder.
    

    I am unable to move beyond this. I have tried Visual Studio Code and it also failed..!

  5. mrmitew commented on Oct 23, 2018

    @mrmitew
    Contributor

    Absolutely same thing here. I submitted a pull request that fixes it: #23397

  6. DaviDeMo89 commented on Oct 23, 2018

    @DaviDeMo89

    Same here... well I started to use flutter in the wrong time haha

  7. mrmitew commented on Oct 23, 2018

    @mrmitew
    Contributor

    Same here... well I started to use flutter in the wrong time haha

    Take a look at the PR I submitted earlier. It resolves the issue.

  8. DaviDeMo89 commented on Oct 23, 2018

    @DaviDeMo89

    Same here... well I started to use flutter in the wrong time haha

    Take a look at the PR I submitted earlier. It resolves the issue.

    thank you, it's working

  9. pboos commented on Oct 24, 2018

    @pboos

    Locally not having the problem even with same version and everything. My guess is that it is because the dependencies are already available locally. Even removing them from ~/.gradle/caches/modules-2/files-2.1/com.android.tools.lint/lint-gradle-api/ didn't reproduce the error locally. Somehow it got them again from somewhere.

    To currently fix it in the server side build I do:

    # Temporary fix for build (see https://github.com/flutter/flutter/issues/23095#issuecomment-432173117)
    sed -i '20 a \ \ \ \ \ \ \ \ google()' /opt/flutter/packages/flutter_tools/gradle/flutter.gradle
    

    Since it runs in docker, I can run this command for every build just before flutter build. But after flutter upgrade because otherwise it will get mad at you for having uncommited changes ;-).

  10. Sky24n commented on Oct 24, 2018

    @Sky24n
    Author

    Win10 OS run error

    FAILURE: Build failed with an exception.

    Where:
    Build file 'D:\Program Files\Android\temp workspace\flutter_appp\android\app\build.gradle' line: 25
    
    What went wrong:
    A problem occurred evaluating project ':app'.
    
    Could not resolve all files for configuration 'classpath'.
    Could not find bundletool.jar (com.android.tools.build:bundletool:0.1.0-alpha01).
    Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/build/bundletool/0.1.0-alpha01/bundletool-0.1.0-alpha01.jar
    Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
    Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
    Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.1.0).
    Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.1.0/aapt2-proto-0.1.0.jar
    
    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
    
  11. waleedbasit commented on Oct 24, 2018

    @waleedbasit

    I don't understand how to fix it, I am facing the same problem. Can someone please explain it to me.

  12. Sky24n commented on Oct 24, 2018

    @Sky24n
    Author

    @waleedbasit
    Temporary solution:

    buildscript {
    dependencies {
            classpath 'com.android.tools.build:gradle:3.0.1'
        }
    
    gradle-wrapper.properties
    distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
    
  13. 9 remaining items

  14. mrmitew commented on Oct 25, 2018

    @mrmitew
    Contributor

    Win10 OS run error

    FAILURE: Build failed with an exception.

    Where:
    Build file 'D:\Program Files\Android\temp workspace\flutter_appp\android\app\build.gradle' line: 25
    
    What went wrong:
    A problem occurred evaluating project ':app'.
    
    Could not resolve all files for configuration 'classpath'.
    Could not find bundletool.jar (com.android.tools.build:bundletool:0.1.0-alpha01).
    Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/build/bundletool/0.1.0-alpha01/bundletool-0.1.0-alpha01.jar
    Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
    Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
    Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.1.0).
    Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.1.0/aapt2-proto-0.1.0.jar
    
    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
    

    It is evident from your error log that gradle isn't looking at the google's repo, but only at jcenter.
    The google() repo has to be added NOT in your gradle file, but in flutter's. A pull request was already merged that fixes the problem (not sure if it was also merged in the beta or only in master).

  15. ViasVegas commented on Oct 25, 2018

    @ViasVegas

    I found the solution there : e93d19c#diff-d9b052388990c36138e397b5bb529025 thanks to @mrmitew .
    Just find the flutter.gradle file in your folder : flutter/package/flutter_tool/gradle and add 'google()' to the buildscript. It fixed the issue for me.

  16. OfficialSameer commented on Oct 25, 2018

    @OfficialSameer

    error

  17. katyak commented on Oct 31, 2018

    @katyak

    @mrmitew solution worked for me. Thank you!

  18. dnfield commented on Oct 31, 2018

    @dnfield
    Contributor

    We will be releasing a new beta soon that contains the fix for this.

  19. harikrishnabikki commented on Nov 1, 2018

    @harikrishnabikki

    Making the answer Clear: All you have to do is go to your have your flutter installed and make sure maven is above jcenter in the flutter.gradle file
    flutter_issue

  20. AmandaMML commented on Nov 2, 2018

    @AmandaMML

    Making the answer Clear: All you have to do is go to your have your flutter installed and make sure maven is above jcenter in the flutter.gradle file
    flutter_issue

    I've tried it. It doesn't work.

  21. franckentien commented on Nov 2, 2018

    @franckentien

    Making the answer Clear: All you have to do is go to your have your flutter installed and make sure maven is above jcenter in the flutter.gradle file
    flutter_issue

    Perfectly work for me

    Thanks

  22. aizuddineismail commented on Nov 2, 2018

    @aizuddineismail

    @AmandaMML Did you try adding google() ? I only followed this and it works!

    I found the solution there : e93d19c#diff-d9b052388990c36138e397b5bb529025 thanks to @mrmitew .
    Just find the flutter.gradle file in your folder : flutter/package/flutter_tool/gradle and add 'google()' to the buildscript. It fixed the issue for me.

  23. AmandaMML commented on Nov 4, 2018

    @AmandaMML

    @AmandaMML Did you try adding google() ? I only followed this and it works!

    I found the solution there : e93d19c#diff-d9b052388990c36138e397b5bb529025 thanks to @mrmitew .
    Just find the flutter.gradle file in your folder : flutter/package/flutter_tool/gradle and add 'google()' to the buildscript. It fixed the issue for me.

    Now it works!! Thank you @aizuddineismail !!

  24. Dhanabhon commented on Nov 4, 2018

    @Dhanabhon

    @AmandaMML Did you try adding google() ? I only followed this and it works!

    I found the solution there : e93d19c#diff-d9b052388990c36138e397b5bb529025 thanks to @mrmitew .
    Just find the flutter.gradle file in your folder : flutter/package/flutter_tool/gradle and add 'google()' to the buildscript. It fixed the issue for me.

    @aizuddineismail I've tried it. It Works!
    Thanks

  25. github-actions commented on Aug 14, 2021

    @github-actions

    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.

  26. locked as resolved and limited conversation to collaborators on Aug 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crasht: gradletool

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions