0

I'm trying to perform my first run of a test app on flutter via Genymotion, but I get nothing except this message in console:

Launching lib\main.dart on Motorola Moto X in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:3.5.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom
       - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.jar
       - https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom
       - https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.jar
     Required by:
         project :

* 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 26s
Finished with error: Gradle task assembleDebug failed with exit code 1

Also (it may be helpful, I think), under the build menu, I don't find some practical sub-menus; such as build, clean, or ...

What could be the problem?

any help is really appreciated!


Since @TaufikNurRahmanda needed the response of flutter doctor and flutter clean commands as more details, I am adding them as an edit;

flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.7, on Microsoft Windows [Version 10.0.10586], locale en-US)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    X Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed
      instructions.
[√] Android Studio (version 3.4)
[√] IntelliJ IDEA Community Edition (version 2019.3)
[√] Connected device (1 available)

! Doctor found issues in 1 category.

flutter clean:

Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Do not run this command from the root of your git clone of Flutter.

Also the response of flutter doctor --android-licenses may be useful (although I have Android SDK Build-tools 29.0.3 installed):

A newer version of the Android SDK is required. To update, run: C:\Users\[user]\AppData\Local\Android\android-sdk\tools\bin\sdkmanager --update

And when I run the suggested command above (sdkmanager --update), I get this:

Error: Could not find or load main class '-Dcom.android.sdklib.toolsdir=C:\Users\[user]\AppData\Local\Android\android-sdk\tools\bin\\..-XX:+IgnoreUnrecognizedVMOptions 
2
  • 1
    have you tried flutter clean and redo the build, or run flutter doctor? Commented Feb 12, 2020 at 14:24
  • Dear @TaufikNurRahmanda; I added their responses . . . Thanks! Commented Feb 12, 2020 at 14:37

1 Answer 1

1

Seems you do not accepted some android licenses. Just run:

flutter doctor --android-licenses

And accept y all licences.

Sign up to request clarification or add additional context in comments.

3 Comments

This is the response: A newer version of the Android SDK is required. To update, run: C:\Users\elyar\AppData\Local\Android\android-sdk\tools\bin\sdkmanager --update. What should I do? I have Android SDK Build-tools 29.0.3 installed.
Are you using a standalone Android-sdk or a AndroidStudio Android-sdk? Double check if you are using the right sdk. If you are using the right sdk, consider this link for solving your issue: github.com/flutter/flutter/issues/31116
I'm using an AndroidStudio Android-sdk . . .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.