1

I'm unable to accept licenses. When I run flutter doctor -v, this is displayed:

[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /home/gledyson/bin/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /home/gledyson/bin/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

Then I run flutter doctor --android-licenses and accept all licenses without an error.

At the end, it says:

All SDK package licenses accepted

But when I run flutter doctor -v again, the warning persists:

[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /home/gledyson/bin/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /home/gledyson/bin/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

I have installed the Android SDK and the Command Line Tools (latest) as shown in the pictures: android sdk 1 android sdk 2

My OS is Linux Mint 20.2.

  • Try changing channel then run flutter doctor – Diwyansh Nov 30 '21 at 17:12
  • Here are a few options: https://stackoverflow.com/questions/48604914/flutter-run-error-you-have-not-accepted-the-license-agreements – AhDev Nov 30 '21 at 17:19
  • I checked the link and found a solution suggesting to run the sdkmanager directly. So I ran it with elevated permissions: sudo ./sdkmanager --licenses. Accepted all licenses again and ran flutter doctor and now it has accepted them correctly. – G. ShadowBroker Nov 30 '21 at 17:34
  • since your ask at : /home/gledyson/bin/sdk – doob Feb 06 '22 at 16:14

2 Answers2

1

The solution I found was to run the sdkmanager directly with elevated permissions using sudo:

sudo ./sdkmanager --licenses

The sdk file was found under sdk/cmdline-tools/latest/bin.

This solved my issues.

1

open cmd and run this command flutter doctor --android-licenses and accept all. this worked for me.