2

I am new to flutter. Here is a list of available tools on SDK Manager - List of tools installed

As you can see I've downloaded the tools. But debugging in the ide shows an error and tells me download a tools that are not installed -

'''

  FAILURE: Build failed with an exception.

  * What went wrong:
  Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
   > Failed to install the following SDK components:
      build-tools;28.0.3 Android SDK Build-Tools 28.0.3
      platforms;android-29 Android SDK Platform 29
    Install the missing components using the SDK manager in Android Studio.
   2

   * 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 51s
   [!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
   Exception: Gradle task assembleDebug failed with exit code 1
   Exited (sigterm)

'''

Please help me out.

Priyanshu Jangra
  • 169
  • 2
  • 13
  • 1
    Not sure about that, but it could probably be licenses issue. Try to run `flutter doctor --android-licenses` from command line. Type `y` and press enter to accept licenses if they are not accepted. – Mol0ko Feb 08 '21 at 11:42
  • This happened for me once.. i restared VSCODE and next time it started in the emulator. I just installed android studio and the command line tools.. maybe it was an enviroment issue – Piotr Kula Jun 06 '23 at 19:36

4 Answers4

0

There seemed to be errors in installing certain dependencies ( sdk 30 ). Might be a technical glitch. Try installing again using flutter doctor.

jeugene
  • 211
  • 1
  • 3
0

I think you have to accept the licenses before building.

Try this command in the terminal

 flutter doctor --android-licenses

Try flutter doctor command in your terminal. which helps us diagnose issues with your setup

flutter doctor

to learn more https://stackoverflow.com/a/55641042/7904389

Theepag
  • 301
  • 2
  • 16
0

Please share the android/app/build.gradle, it is probably targeting API level 29 (targetSdkVersion 29 and compileSdkVersion 29). Change them to 30 or download the API level 29 SDKs.

If it still doesn't work after that, the SDK might be missing, go to the ANDROID_HOME directory and ensure it contains an sdk directory with the stuff you want.

Ben Butterworth
  • 22,056
  • 10
  • 114
  • 167
0

I couldn't figure out what the error was, but creating a new project worked for me.

Priyanshu Jangra
  • 169
  • 2
  • 13