javaandroidfluttersdk

Flutter can't accept android licenses


I have set up Flutter in my Ubuntu Machine, but cannot accept the Android Licenses, thus am not able to use the tool. Flutter appears to be working fine in root, but when I try to run flutter doctor it tells me that Android Licenses have not been accepted, even though I did accept them. If I try to type again flutter doctor --android-licenses it works as though I never accepted the licenses. If I accept all of them once more, it just gets back to as though I never accepted them. I could use flutter in root, but that's not really secure and I would rather have it usable as a normal user.

EDIT: The solution appears to lie in the repositories.cfg file. It appeared to be missing and adding a blank file with that name solved the issue.


Solution

  • Go to your $ANDROID_HOME/tools/bin and open the command line

    Run the following command ./sdkmanager --licenses

    Accept All licenses listed there.