11

Android toolchain - develop for Android devices (Android SDK 26.0.2) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

It gives error reading dependency file and then flutter crashes. Is it something to do with dart to or am i missing something here?

1
  • In Android Studio, you should check to ensure that the Android SDK Command-line Tools are installed. Adding this fixed the issue for me in Flutter. stackoverflow.com/a/67791870/8094969
    – bm888
    Jun 1, 2021 at 15:36

4 Answers 4

14

As it says in the message:

To resolve this, run: flutter doctor --android-licenses

2
  • i cant run flutter doctor
    – Sachihiro
    Jun 5, 2018 at 18:31
  • i ran fluttere doctor and accepted all but still the same issue.
    – Sachihiro
    Jun 5, 2018 at 18:38
8

In your flutter folder you can find flutter_console.bat.

enter image description here

Open it and write the following:

  • flutter doctor --android-licensesenter image description here
4
  • I did this already and accepted all the licenses and All SDK package licenses accepted. But finish with error: Gradle build failed: 1
    – Sachihiro
    Jun 5, 2018 at 18:43
  • Check if you have the added route of Dart SDK and Flutter SDK
    – DomingoMG
    Jun 5, 2018 at 18:46
  • i created another project, and it runs perfectly ok, builds gradle and etc, but this error occurs only at one particular project but the thing that i don't understand is that it does not show any error in my code.
    – Sachihiro
    Jun 5, 2018 at 18:55
  • After this, close and reopen Android Studio
    – Hanako
    May 17, 2019 at 19:10
5

You have to run an elevated command prompt in order to accept the license. Go to the windows start menu, type CMD then right click the Command Prompt and select Run as Administrator. This will start the command line with elevated priviliges.

enter image description here

1
  • This is the right answer if you see this line: ` Warning: File C:\Users\XXX\.android\repositories.cfg could not be loaded.`
    – Guy P
    Nov 19, 2019 at 20:52
1

In my case flutter doctor command didn't help me, Flutter used default project SDK in enter image description here C Drive: C:\Users\PC\AppData\Local\Android\Sdk which is missing licenses folder, But I use different SDK for building application which has licenses folder I copied that to C Drive SDK then the problem has solved then Flutter app got installed in the mobile.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.